How to repeat:
1) start game
2) go to the second dungeon (click "page down" twice, there are more enemies)
3) try to fight with mobs (walk around them and try to hit)
Issue explanation:
It crashes when target position is the same with player position. Vec2Fix is created with zeroes and getIsometricDirection is called. During normalize function call, division by "0" happens.
I think that it's better to return default direction when getIsometricDirection is called on Vec2Fix(0, 0).
Another solution is to prevent overlapping, but it doesn't looks good.
Game crashes.
How to repeat: 1) start game 2) go to the second dungeon (click "page down" twice, there are more enemies) 3) try to fight with mobs (walk around them and try to hit)
Issue explanation: It crashes when target position is the same with player position. Vec2Fix is created with zeroes and
getIsometricDirection
is called. Duringnormalize
function call, division by "0" happens.Dump:
I think that it's better to return default direction when
getIsometricDirection
is called onVec2Fix(0, 0)
. Another solution is to prevent overlapping, but it doesn't looks good.