Fix elevator usage

Current elevation was not properly passed to `elevator_select`.

Closes #53
This commit is contained in:
Alexander Batalov 2023-02-27 13:42:03 +03:00
parent 8105529d68
commit 4ad05de233

View File

@ -61,7 +61,6 @@ typedef struct ScriptState {
STRUCT_664980 combatState1;
STRUCT_664980 combatState2;
int elevatorType;
int elevatorLevel;
int explosionTile;
int explosionElevation;
int explosionMinDamage;
@ -802,7 +801,7 @@ int scripts_check_state()
if ((scriptState.requests & SCRIPT_REQUEST_ELEVATOR) != 0) {
int map = map_data.field_34;
int elevation = scriptState.elevatorLevel;
int elevation = map_elevation;
int tile = -1;
scriptState.requests &= ~SCRIPT_REQUEST_ELEVATOR;
@ -909,7 +908,7 @@ int scripts_check_state_in_combat()
{
if ((scriptState.requests & SCRIPT_REQUEST_ELEVATOR) != 0) {
int map = map_data.field_34;
int elevation = scriptState.elevatorLevel;
int elevation = map_elevation;
int tile = -1;
if (elevator_select(scriptState.elevatorType, &map, &elevation, &tile) != -1) {