Skip to content

Commit

Permalink
tr2/lara/cheat: test zero or negative hit points when killing enemies
Browse files Browse the repository at this point in the history
This sets the skidoo driver's HP to DONT_TARGET after using the kill
cheat, and updates Lara's test for which enemies to include to ignore
anything with zero or negative HP, which resolves the issue of being
able to cheat-kill the dragon multiple times.

Resolves #1995.
  • Loading branch information
lahm86 committed Dec 14, 2024
1 parent b407bfd commit f39d13b
Show file tree
Hide file tree
Showing 3 changed files with 4 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 @@ -58,6 +58,7 @@
- fixed screenshots not capturing level stats (#1925, regression from 0.6)
- fixed screenshots sometimes crashing in the windowed mode (regression from 0.6)
- fixed creatures being able to swim/fly above the ceiling up to one tile (#1936, regression from 0.1)
- fixed the `/kill all` command reporting an incorrect count in some levels (#1995, regression from 0.3)
- 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 src/tr2/game/creature.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ void __cdecl Creature_Die(const int16_t item_num, const bool explode)
if (explode) {
Effect_ExplodingDeath(item_num, -1, 0);
}
item->hit_points = DONT_TARGET;
const int16_t vehicle_item_num = (int16_t)(intptr_t)item->data;
ITEM *const vehicle_item = &g_Items[vehicle_item_num];
vehicle_item->hit_points = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/tr2/game/lara/cheat.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,8 @@ bool Lara_Cheat_Teleport(int32_t x, int32_t y, int32_t z)

bool Lara_Cheat_KillEnemy(const int16_t item_num)
{
ITEM *const item = &g_Items[item_num];
if ((item->hit_points == DONT_TARGET && item->object_id != O_WINSTON)) {
ITEM *const item = Item_Get(item_num);
if (item->hit_points <= 0 && item->object_id != O_WINSTON) {
return false;
}

Expand Down

0 comments on commit f39d13b

Please sign in to comment.