CaravelGames / drod

The official public repository of Deadly Rooms of Death and DROD RPG
http://caravelgames.com
56 stars 17 forks source link

Fix bad character orientation due to no pathfinding move #544

Closed Hypexion closed 1 year ago

Hypexion commented 1 year ago

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.

Thread: https://forum.caravelgames.com/viewtopic.php?TopicID=45994