Skip to content

Commit

Permalink
tr2/inventory: fix level number for play any level
Browse files Browse the repository at this point in the history
This increments the selected level to play only if there is a gym level
present.

Resolves #2560.
  • Loading branch information
lahm86 committed Feb 27, 2025
1 parent 7e4ceb6 commit a9d7fdf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/tr2/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- fixed smashed windows blocking enemy pathing after loading a save (#2535)
- fixed a rare issue whereby Lara would be unable to move after disposing a flare (#2545, regression from 0.9)
- fixed flare pickups only adding one flare to Lara's inventory rather than six (#2551, regression from 0.9)
- fixed play any level causing the game to hang when no gym level is present (#2560, regression from 0.9)

## [0.9.2](https://github.com/LostArtefacts/TRX/compare/tr2-0.9.1...tr2-0.9.2) - 2025-02-19
- fixed secret rewards not handed out after loading a save (#2528, regression from 0.8)
Expand Down
6 changes: 4 additions & 2 deletions src/tr2/game/inventory_ring/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ static GF_COMMAND M_Finish(INV_RING *const ring, const bool apply_changes)
if (g_GameFlow.play_any_level) {
return (GF_COMMAND) {
.action = GF_START_GAME,
.param = g_Inv_ExtraData[1] + 1,
.param = g_Inv_ExtraData[1]
+ (GF_GetGymLevel() != nullptr ? 1 : 0),
};
} else {
if (apply_changes) {
Expand All @@ -224,7 +225,8 @@ static GF_COMMAND M_Finish(INV_RING *const ring, const bool apply_changes)
if (g_GameFlow.play_any_level) {
return (GF_COMMAND) {
.action = GF_START_GAME,
.param = g_Inv_ExtraData[1] + 1,
.param = g_Inv_ExtraData[1]
+ (GF_GetGymLevel() != nullptr ? 1 : 0),
};
} else {
return (GF_COMMAND) {
Expand Down

0 comments on commit a9d7fdf

Please sign in to comment.