Skip to content

Commit

Permalink
tr2/objects/detonator: check for chosen inventory object
Browse files Browse the repository at this point in the history
This allows manually selecting the detonator key or gong hammer from
the inventory when beside the corresponding item. A similar check is
done in regular keyhole/puzzle collision.

Resolves #1887.
  • Loading branch information
lahm86 committed Nov 27, 2024
1 parent fd005ac commit b0073ca
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/tr2/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
- fixed broken final stats screen in software rendering mode (#1915, regression from 0.6)
- fixed screenshots not capturing level stats (#1925, regression from 0.6)
- fixed screenshots sometimes crashing in the windowed mode (regression from 0.6)
- fixed the detonator key and gong hammer not activating their target items when manually selected from the inventory (#1887)

## [0.6](https://github.com/LostArtefacts/TRX/compare/tr2-0.5...tr2-0.6) - 2024-11-06
- added a fly cheat key (#1642)
Expand Down
1 change: 1 addition & 0 deletions docs/tr2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ decompilation process. We recognize that there is much work to be done.
- fixed the distorted skybox in room 5 of Barkhang Monastery
- fixed new saves not displaying the save count in the passport
- fixed Lara getting stuck in her hit animation if she is hit while mounting the boat or skidoo
- fixed the detonator key and gong hammer not activating their target items when manually selected from the inventory
- fixed the following floor data issues:
- **Opera House**: fixed the trigger under item 203 to trigger it rather than item 204
- **Tibetan Foothills**: added missing triggers for the drawbridge in room 96 (after the flipmap)
Expand Down
3 changes: 2 additions & 1 deletion src/tr2/game/objects/general/detonator.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ void __cdecl Detonator_Collision(
item->rot.y = lara_item->rot.y;
item->rot.z = 0;

if (item->status == IS_DEACTIVATED || !g_Input.action
if (item->status == IS_DEACTIVATED
|| (g_Inv_Chosen == NO_OBJECT && !g_Input.action)
|| g_Lara.gun_status != LGS_ARMLESS || lara_item->gravity
|| lara_item->current_anim_state != LS_STOP) {
goto normal_collision;
Expand Down

0 comments on commit b0073ca

Please sign in to comment.