Skip to content

Commit

Permalink
tr2/objects/final_level_counter: reset Lara's flare status for cutscene
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lahm86 committed Dec 8, 2024
1 parent 98e79f9 commit a590de2
Show file tree
Hide file tree
Showing 3 changed files with 12 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 @@ -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
Expand Down
1 change: 1 addition & 0 deletions docs/tr2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 10 additions & 2 deletions src/tr2/game/objects/general/final_level_counter.c
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit a590de2

Please sign in to comment.