Skip to content

Commit

Permalink
Fixed PC swapping not resetting the follower steps
Browse files Browse the repository at this point in the history
  • Loading branch information
AsparagusEduardo committed Jul 27, 2024
1 parent d7a38a1 commit 83b9f89
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/pokemon_storage_system.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "dma3.h"
#include "dynamic_placeholder_text_util.h"
#include "event_data.h"
#include "event_object_movement.h"
#include "field_screen_effect.h"
#include "field_weather.h"
#include "fldeff_misc.h"
Expand Down Expand Up @@ -6412,9 +6413,15 @@ static void RefreshDisplayMon(void)
static void SetMovingMonData(u8 boxId, u8 position)
{
if (boxId == TOTAL_BOXES_COUNT)
{
sStorage->movingMon = gPlayerParty[sCursorPosition];
if (&gPlayerParty[sCursorPosition] == GetFirstLiveMon())
gFollowerSteps = 0;
}
else
{
BoxMonAtToMon(boxId, position, &sStorage->movingMon);
}

PurgeMonOrBoxMon(boxId, position);
sMovingMonOrigBoxId = boxId;
Expand All @@ -6427,9 +6434,15 @@ static void SetPlacedMonData(u8 boxId, u8 position)
HealPokemon(&sStorage->movingMon);

if (boxId == TOTAL_BOXES_COUNT)
{
gPlayerParty[position] = sStorage->movingMon;
if (&gPlayerParty[position] == GetFirstLiveMon())
gFollowerSteps = 0;
}
else
{
SetBoxMonAt(boxId, position, &sStorage->movingMon.box);
}
}

static void PurgeMonOrBoxMon(u8 boxId, u8 position)
Expand Down

0 comments on commit 83b9f89

Please sign in to comment.