Skip to content

Commit

Permalink
tr2/gun_rifle: fix harpoon recoil in NG+
Browse files Browse the repository at this point in the history
This ensures that harpoon ammo is decremented in NG+ so that the recoil
check continues as normal after 4 rounds. The ammo is always
incremented by 4 so that infinite ammo remains.

Resolves LostArtefacts#1575.
  • Loading branch information
lahm86 committed Oct 26, 2024
1 parent 4f38037 commit 0a6ca5f
Show file tree
Hide file tree
Showing 3 changed files with 6 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 @@ -12,6 +12,7 @@
- fixed the audio not being in sync when Lara strikes the gong in Ice Palace (#1725)
- fixed door cheat not working with drawbridges (#1748)
- fixed Lara's underwater hue being retained when re-entering a boat (#1596)
- fixed Lara reloading the harpoon gun after every shot in NG+ (#1575)

## [0.5](https://github.com/LostArtefacts/TRX/compare/afaf12a...tr2-0.5) - 2024-10-08
- added `/sfx` command
Expand Down
1 change: 1 addition & 0 deletions docs/tr2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ decompilation process. We recognize that there is much work to be done.
- fixed explosions sometimes being drawn too dark
- fixed controls dialog remapping being too sensitive
- fixed the distorted skybox in room 5 of Barkhang Monastery
- fixed Lara reloading the harpoon gun after every shot in NG+

#### Visuals

Expand Down
6 changes: 4 additions & 2 deletions src/tr2/game/gun/gun_rifle.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,10 @@ void __cdecl Gun_Rifle_FireHarpoon(void)
item->speed = (HARPOON_BOLT_SPEED * Math_Cos(item->rot.x)) >> W2V_SHIFT;
Item_AddActive(item_num);

if (!g_SaveGame.bonus_flag) {
g_Lara.harpoon_ammo.ammo--;
g_Lara.harpoon_ammo.ammo--;
if (g_SaveGame.bonus_flag
&& (g_Lara.harpoon_ammo.ammo % HARPOON_RECOIL) == 0) {
g_Lara.harpoon_ammo.ammo += HARPOON_RECOIL;
}
g_SaveGame.statistics.shots++;
}
Expand Down

0 comments on commit 0a6ca5f

Please sign in to comment.