This is a completely vanilla issue, even though it was observed in a modded game. The reason I did not reproduce it in a vanilla game is because the situation is extremely hard and time consuming to reproduce – but it can happen.
Describe the bug
The game crashes when an Unhold uses Sweeping Strike and knocks a bro back, but the Unhold dies before the bro has finished being knocked back to a tile. The game crashes in some kind of updateVisibilityForFaction function, because the Unhold is dead. Possibly that function needs a check for if the actor is still alive.
To Reproduce
Steps to reproduce the behavior:
1. Surround an Unhold with bros and use Riposte.
2. Let the Unhold attack and trigger it in a way that he knocks back a bro, but the Riposte from the other bro kills the Unhold.
3. As the Unhold dies before the knocked back bro lands on his tile, the game crashes.
Here is a video of it happening. Again, the video is from a modded game because the situation is tedious to reproduce, but the issue is not caused by any mod.
https://clips.twitch.tv/ObliqueDeafChimpanzeeSaltBae-K7WnykN9_tRnuWQU
Cause:
In the onMovementFinish
function of actor
, there is an if statement which says:
if (this.Tactical.TurnSequenceBar.getActiveEntity() != null && this.Tactical.TurnSequenceBar.getActiveEntity().getID() != this.getID())
{
this.Tactical.TurnSequenceBar.getActiveEntity().updateVisibilityForFaction();
}
The issue happens because this if block runs when the Unhold is dead (Unhold is the active entity). Therefore, the if
should include a check for the active entity being alive, or such a check should be baked into updateVisibilityForFaction
.