tr2/objects/final_level_counter: reset Lara's flare status for cutscene

This will discard a flare if Lara has one active before triggering the
final cutscene in Home Sweet Home, and reset Lara's hands accordingly.

Resolves #1992.
This commit is contained in:
lahm86 2024-12-08 12:26:09 +00:00
parent 98e79f9da0
commit a590de2c03
3 changed files with 12 additions and 2 deletions

View file

@ -32,6 +32,7 @@
- fixed room 98 in Wreck of the Maria Doria not having water (#1939)
- fixed a potential crash if Lara is on the skidoo in a room with many other adjoining rooms (#1987)
- fixed a softlock in Home Sweet Home if the final cutscene is triggered while Lara is on water surface (#1701)
- fixed Lara's left arm becoming stuck if a flare is drawn just before the final cutscene in Home Sweet Home (#1992)
- removed unused detail level option
## [0.6](https://github.com/LostArtefacts/TRX/compare/tr2-0.5...tr2-0.6) - 2024-11-06

View file

@ -42,6 +42,7 @@ decompilation process. We recognize that there is much work to be done.
- fixed the detonator key and gong hammer not activating their target items when manually selected from the inventory
- fixed a potential crash if Lara is on the skidoo in a room with many other adjoining rooms
- fixed a softlock in Home Sweet Home if the final cutscene is triggered while Lara is on water surface
- fixed Lara's left arm becoming stuck if a flare is drawn just before the final cutscene in Home Sweet Home
- fixed the following floor data issues:
- **Opera House**: fixed the trigger under item 203 to trigger it rather than item 204
- **Wreck of the Maria Doria**: fixed room 98 not having water

View file

@ -1,6 +1,8 @@
#include "game/objects/general/final_level_counter.h"
#include "decomp/flares.h"
#include "game/creature.h"
#include "game/gun/gun.h"
#include "game/items.h"
#include "game/los.h"
#include "game/lot.h"
@ -63,14 +65,20 @@ static void __cdecl M_ActivateLastBoss(void)
static void __cdecl M_PrepareCutscene(const int16_t item_num)
{
if (g_Lara.gun_type == LGT_FLARE) {
Flare_Undraw();
g_Lara.flare_control_left = false;
g_Lara.left_arm.lock = false;
}
Gun_SetLaraHandLMesh(LGT_UNARMED);
Gun_SetLaraHandRMesh(LGT_UNARMED);
g_Lara.water_status = LWS_ABOVE_WATER;
ITEM *const item = &g_Items[item_num];
Creature_Kill(item, 0, 0, LA_EXTRA_FINAL_ANIM);
g_Camera.type = CAM_CINEMATIC;
g_Lara.mesh_ptrs[LM_HAND_R] =
g_Meshes[g_Objects[O_LARA].mesh_idx + LM_HAND_R];
g_CineFrameIdx = 428;
g_CinePos.pos = item->pos;
g_CinePos.rot = item->rot;