Skip to content

Commit

Permalink
Merge pull request #853 from AreaZeroArven/do-some-work
Browse files Browse the repository at this point in the history
event_object_movement: un-assembler InitObjectEventStateFromTemplate
  • Loading branch information
RevoSucks authored Jan 7, 2023
2 parents df0a97c + 1ef5efc commit 0f86137
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/event_object_movement.c
Original file line number Diff line number Diff line change
Expand Up @@ -1169,7 +1169,6 @@ static u8 InitObjectEventStateFromTemplate(struct ObjectEventTemplate *template,
objectEvent->movementType = template->movementType;
objectEvent->localId = template->localId;
objectEvent->mapNum = mapNum;
asm("":::"r6");
objectEvent->mapGroup = mapGroup;
objectEvent->initialCoords.x = initialX;
objectEvent->initialCoords.y = initialY;
Expand All @@ -1182,10 +1181,10 @@ 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 required to match
objectEvent->trainerRange_berryTreeId = template->trainerRange_berryTreeId;
objectEvent->previousMovementDirection = gInitialMovementTypeFacingDirections[template->movementType];
SetObjectEventDirection(objectEvent, objectEvent->previousMovementDirection);
asm("":::"r5","r6");
SetObjectEventDynamicGraphicsId(objectEvent);

if (gRangedMovementTypes[objectEvent->movementType])
Expand Down Expand Up @@ -1224,7 +1223,7 @@ u8 TryInitLocalObjectEvent(u8 localId)

static bool8 GetAvailableObjectEventId(u16 localId, u8 mapNum, u8 mapGroup, u8 *objectEventId)
{
u8 i = 0;
u8 i;

for (i = 0; i < OBJECT_EVENTS_COUNT; i++)
{
Expand Down

0 comments on commit 0f86137

Please sign in to comment.