[LEAK-INFORMED] match InitObjectEventStateFromTemplate

additionally, port range fixes from emerald as well as a couple other
things
This commit is contained in:
Kurausukun
2021-03-18 22:30:59 -04:00
parent a2367448b8
commit f41d7b222c
5 changed files with 90 additions and 311 deletions
+6 -6
View File
@@ -219,15 +219,15 @@ static u8 CheckPathBetweenTrainerAndPlayer(struct ObjectEvent *trainerObj, u8 ap
}
// preserve mapobj_unk_19 before clearing.
unk19_temp = trainerObj->range.as_nybbles.x;
unk19b_temp = trainerObj->range.as_nybbles.y;
trainerObj->range.as_nybbles.x = 0;
trainerObj->range.as_nybbles.y = 0;
unk19_temp = trainerObj->rangeX;
unk19b_temp = trainerObj->rangeY;
trainerObj->rangeX = 0;
trainerObj->rangeY = 0;
collision = GetCollisionAtCoords(trainerObj, x, y, direction);
trainerObj->range.as_nybbles.x = unk19_temp;
trainerObj->range.as_nybbles.y = unk19b_temp;
trainerObj->rangeX = unk19_temp;
trainerObj->rangeY = unk19b_temp;
if (collision == 4)
return approachDistance;