Skip to content

Commit

Permalink
missile: test damage range for overflow
Browse files Browse the repository at this point in the history
Resolves #871.
  • Loading branch information
lahm86 authored Jun 5, 2023
1 parent fc1a70c commit d6cc3c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
- fixed quick load creating an invalid save if used when no saves are present (#853)
- fixed Lara entering body hit animations when not appropriate to do so (#857)
- fixed SkateKid causing a game crash when too many enemies are active (#866)
- fixed missiles damaging Lara when she is far beyond their damage range (#871)

## [2.14](https://github.com/rr-/Tomb1Main/compare/2.13.2...2.14) - 2023-04-05
- added Spanish localization to the config tool
Expand Down
2 changes: 1 addition & 1 deletion src/game/objects/effects/missile.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void Missile_Control(int16_t fx_num)
int32_t y = fx->pos.y - g_LaraItem->pos.y;
int32_t z = fx->pos.z - g_LaraItem->pos.z;
int32_t range = SQUARE(x) + SQUARE(y) + SQUARE(z);
if (range < ROCKET_RANGE) {
if (range >= 0 && range < ROCKET_RANGE) {
g_LaraItem->hit_points -=
(int16_t)(ROCKET_DAMAGE * (ROCKET_RANGE - range) / ROCKET_RANGE);
g_LaraItem->hit_status = 1;
Expand Down

0 comments on commit d6cc3c4

Please sign in to comment.