Skip to content

Commit

Permalink
gameflow: fix override ignored in some sequences
Browse files Browse the repository at this point in the history
  • Loading branch information
rr- committed Sep 2, 2024
1 parent 0899662 commit 1a42b86
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## [Unreleased](https://github.com/LostArtefacts/TR1X/compare/stable...develop) - ××××-××-××
- added `/exit` command (#1462)
- fixed `/play`, `/load`, `/demo` and similar commands not working in stats, credits, cinematics and fmvs (#1477)
- fixed reopening the compass not resetting its needle (#1472, regression from 4.0)
- fixed holstering pistols hiding the gun meshes 1 frame too early (#1449, regression from 0.6)
- fixed Lara's sliding animation sometimes being interrupted by a stumble (#1452, regression from 4.3)
Expand Down
26 changes: 26 additions & 0 deletions src/game/gameflow.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ static bool GameFlow_LoadLevelSequence(
seq->data = Memory_DupStr(tmp_s);
break;
}

case GFS_LOADING_SCREEN:
case GFS_DISPLAY_PICTURE: {
GAMEFLOW_DISPLAY_PICTURE_DATA *data =
Expand Down Expand Up @@ -345,6 +346,7 @@ static bool GameFlow_LoadLevelSequence(
seq->data = data;
break;
}

case GFS_LEVEL_STATS: {
int tmp =
json_object_get_int(jseq_obj, "level_id", JSON_INVALID_NUMBER);
Expand All @@ -357,6 +359,7 @@ static bool GameFlow_LoadLevelSequence(
seq->data = (void *)(intptr_t)tmp;
break;
}

case GFS_TOTAL_STATS: {
GAMEFLOW_DISPLAY_PICTURE_DATA *data =
Memory_Alloc(sizeof(GAMEFLOW_DISPLAY_PICTURE_DATA));
Expand All @@ -374,6 +377,7 @@ static bool GameFlow_LoadLevelSequence(
seq->data = data;
break;
}

case GFS_EXIT_TO_TITLE:
break;

Expand All @@ -390,6 +394,7 @@ static bool GameFlow_LoadLevelSequence(
seq->data = (void *)(intptr_t)tmp;
break;
}

case GFS_SET_CAM_X:
case GFS_SET_CAM_Y:
case GFS_SET_CAM_Z:
Expand All @@ -405,6 +410,7 @@ static bool GameFlow_LoadLevelSequence(
seq->data = (void *)(intptr_t)tmp;
break;
}

case GFS_FLIP_MAP:
case GFS_REMOVE_GUNS:
case GFS_REMOVE_SCIONS:
Expand All @@ -431,6 +437,7 @@ static bool GameFlow_LoadLevelSequence(
seq->data = give_item_data;
break;
}

case GFS_PLAY_SYNCED_AUDIO: {
int tmp =
json_object_get_int(jseq_obj, "audio_id", JSON_INVALID_NUMBER);
Expand All @@ -443,6 +450,7 @@ static bool GameFlow_LoadLevelSequence(
seq->data = (void *)(intptr_t)tmp;
break;
}

case GFS_MESH_SWAP: {
GAMEFLOW_MESH_SWAP_DATA *swap_data =
Memory_Alloc(sizeof(GAMEFLOW_MESH_SWAP_DATA));
Expand Down Expand Up @@ -477,6 +485,7 @@ static bool GameFlow_LoadLevelSequence(
seq->data = swap_data;
break;
}

case GFS_SETUP_BACON_LARA: {
int tmp = json_object_get_int(
jseq_obj, "anchor_room", JSON_INVALID_NUMBER);
Expand All @@ -495,6 +504,7 @@ static bool GameFlow_LoadLevelSequence(
seq->data = (void *)(intptr_t)tmp;
break;
}

default:
if (GameFlow_IsLegacySequence(type_str)) {
seq->type = GFS_LEGACY;
Expand Down Expand Up @@ -1148,6 +1158,10 @@ GameFlow_InterpretSequence(int32_t level_num, GAMEFLOW_LEVEL_TYPE level_type)
case GFS_LOOP_CINE:
if (level_type != GFL_SAVED) {
command = Phase_Run();
if (command.action != GF_CONTINUE_SEQUENCE
&& command.action != GF_LEVEL_COMPLETE) {
return command;
}
}
break;

Expand All @@ -1163,6 +1177,9 @@ GameFlow_InterpretSequence(int32_t level_num, GAMEFLOW_LEVEL_TYPE level_type)
};
Phase_Set(PHASE_STATS, &phase_args);
command = Phase_Run();
if (command.action != GF_CONTINUE_SEQUENCE) {
return command;
}
break;
}

Expand All @@ -1178,6 +1195,9 @@ GameFlow_InterpretSequence(int32_t level_num, GAMEFLOW_LEVEL_TYPE level_type)
};
Phase_Set(PHASE_STATS, &phase_args);
command = Phase_Run();
if (command.action != GF_CONTINUE_SEQUENCE) {
return command;
}
}
break;

Expand All @@ -1203,6 +1223,9 @@ GameFlow_InterpretSequence(int32_t level_num, GAMEFLOW_LEVEL_TYPE level_type)
};
Phase_Set(PHASE_PICTURE, &phase_arg);
command = Phase_Run();
if (command.action != GF_CONTINUE_SEQUENCE) {
return command;
}
break;

case GFS_EXIT_TO_TITLE:
Expand Down Expand Up @@ -1364,6 +1387,9 @@ GameFlow_StorySoFar(int32_t level_num, int32_t savegame_level)

case GFS_LOOP_CINE:
command = Phase_Run();
if (command.action != GF_CONTINUE_SEQUENCE) {
return command;
}
break;

case GFS_PLAY_FMV:
Expand Down

0 comments on commit 1a42b86

Please sign in to comment.