If a character has the MIQ_PathfindOpenOnly movement type, and no move is available, CCharacter::GetMovement will not set values for the dxFirst and dyFirst arguments. These then get used to try to set an orientation, which ends up being invalid. When the character is next drawn, the game will crash.
To fix, dxFirst and dyFirst should be set to zero in the no-move case for pathfinding. Additionally, I have tweaked CMonster::SetOrientation so that it will not set wO to an invalid orientation. This should mean that any future incidents have less catastrophic results.
If a character has the
MIQ_PathfindOpenOnly
movement type, and no move is available,CCharacter::GetMovement
will not set values for thedxFirst
anddyFirst
arguments. These then get used to try to set an orientation, which ends up being invalid. When the character is next drawn, the game will crash.To fix,
dxFirst
anddyFirst
should be set to zero in the no-move case for pathfinding. Additionally, I have tweakedCMonster::SetOrientation
so that it will not setwO
to an invalid orientation. This should mean that any future incidents have less catastrophic results.Thread: https://forum.caravelgames.com/viewtopic.php?TopicID=45994