DestinationSol icon indicating copy to clipboard operation
DestinationSol copied to clipboard

(minor) When getting crushed between a starport and a hub, you can have negative HP

Open Esnardo opened this issue 5 years ago • 1 comments

This one is kinda rare since it involves having a save where a planet generates so close to a hub that it's startport will intersect the hub within a reasonable timeframe. It also doesn't affect gameplay (all effects clear on respawn), so it's a really low priority unless there's another way to trigger it (maybe you don't need 2 immovable objects?)

Issue: see title

Repro:

  1. Generate a world where a starport passes through a hub
  2. get crushed in the gap
  3. Sometimes your HP bar will show up as negative

V2.0.0

LGK20, Android

Esnardo avatar Dec 03 '20 20:12 Esnardo

For anyone interested in fixing this, it should be easy enough to clamp ship health so that it doesn't go below zero. If it does, then it should just be reset to 0. The code referenced below should be responsible for ship damage: https://github.com/MovingBlocks/DestinationSol/blob/fa2a67e059b8bbd6d7a25836d04d999ffb0b860b/engine/src/main/java/org/destinationsol/game/ship/SolShip.java#L450-L464

BenjaminAmos avatar Mar 11 '23 20:03 BenjaminAmos