tr2/objects/detonator: check for chosen inventory object

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.
This commit is contained in:
lahm86 2024-11-27 20:39:37 +00:00
parent fd005acde3
commit 6fe47ec0ab
3 changed files with 4 additions and 1 deletions

View file

@ -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)

View file

@ -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)

View file

@ -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;