Fix game freeze when trainers try to walk on sideway stairs (#8316)
This commit is contained in:
parent
65a5d1e7d8
commit
8ba99b09d7
@ -522,6 +522,9 @@ static u8 GetTrainerApproachDistance(struct ObjectEvent *trainerObj)
|
||||
PlayerGetDestCoords(&x, &y);
|
||||
if (trainerObj->trainerType == TRAINER_TYPE_NORMAL) // can only see in one direction
|
||||
{
|
||||
// Disable trainer approach while moving diagonally (usually moving on sideway stairs)
|
||||
if (trainerObj->facingDirection > DIR_EAST)
|
||||
return 0;
|
||||
approachDistance = sDirectionalApproachDistanceFuncs[trainerObj->facingDirection - 1](trainerObj, trainerObj->trainerRange_berryTreeId, x, y);
|
||||
return CheckPathBetweenTrainerAndPlayer(trainerObj, approachDistance, trainerObj->facingDirection);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user