Merge pull request #1115 from PokeCodec/Matching

Match InitObjectEventStateFromTemplate
This commit is contained in:
PikalaxALT 2020-07-28 15:56:58 -04:00 committed by GitHub
commit 96b904bf80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1220,7 +1220,6 @@ static u8 InitObjectEventStateFromTemplate(struct ObjectEventTemplate *template,
objectEvent->movementType = template->movementType;
objectEvent->localId = template->localId;
objectEvent->mapNum = mapNum;
objectEvent++; objectEvent--;
objectEvent->mapGroup = mapGroup;
objectEvent->initialCoords.x = x;
objectEvent->initialCoords.y = y;
@ -1233,13 +1232,11 @@ 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);
SetObjectEventDynamicGraphicsId(objectEvent);
#ifndef NONMATCHING
asm("":::"r5", "r6");
#endif
if (gRangedMovementTypes[objectEvent->movementType])
{
if (objectEvent->range.as_nybbles.x == 0)