zcdziura / dreadnought

An automated aetherhunting system for Lusternia
The Unlicense
5 stars 3 forks source link

Race condition in autopilot module #1

Open johnathansult opened 8 years ago

johnathansult commented 8 years ago

If a creature is destroyed in the time between the system sending a move command and the ship moving into shockwaves, the system considers itself to still have mobility and immediately paths home despite not actually being able to move. This causes the internal path tracker to reflect the ship being 'home' at the vortex despite the ship still being in the shockwaves.

johnathansult commented 8 years ago

Solution: When the autopilot moves, mark the ship as being off-balance (which it will be once the move command is processed). Also, disable the prompt-parsing balance trigger to prevent the balance from flicking back on immediately.