This commit is contained in:
PokeCodec 2020-07-28 15:31:08 -04:00
parent 3b43fc12fc
commit 93be3a08ce

View File

@ -1205,7 +1205,8 @@ static u8 InitObjectEventStateFromTemplate(struct ObjectEventTemplate *template,
{
struct ObjectEvent *objectEvent;
u8 objectEventId;
s16 x, y;
s16 x;
s16 y;
if (GetAvailableObjectEventId(template->localId, mapNum, mapGroup, &objectEventId))
return OBJECT_EVENTS_COUNT;
@ -1231,6 +1232,7 @@ static u8 InitObjectEventStateFromTemplate(struct ObjectEventTemplate *template,
objectEvent->range.as_nybbles.x = template->movementRangeX;
objectEvent->range.as_nybbles.y = template->movementRangeY;
objectEvent->trainerType = template->trainerType;
objectEvent->mapNum = mapNum; //redundant, but needed to match
objectEvent->trainerRange_berryTreeId = template->trainerRange_berryTreeId;
objectEvent->previousMovementDirection = gInitialMovementTypeFacingDirections[template->movementType];
SetObjectEventDirection(objectEvent, objectEvent->previousMovementDirection);