chrishayesmu / XCOM-LW-CommunityEdition

14 stars 2 forks source link

sightlines: Fix helpers getting stuck on wrong tile #57

Closed moben closed 2 years ago

moben commented 2 years ago

There are some cases where the sightline helper can get stuck when moving the cursor a single tile. This is most easily reproduced when moving the cursor across blue/yellow move border.

What happens is that OnCursorMoved triggers but the path is temporarily invalid as (I think) the movement limit is updated for the yellow move range. Because the path is invalid (i.e. destination 0), the helper is not moved and as long as the cursor is not moved remains in the last tile.

I can imagine this also happening in other cases, e.g. when tiles are blocked/unblocked by fire or explosives but maybe the cursor position stays still or simply when moving to/from/over invalid destinations.