diff --git a/include/overworld.h b/include/overworld.h index e0df9c3b89..91a88dc88c 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -93,6 +93,7 @@ void SetDynamicWarpWithCoords(s32 unused, s8 mapGroup, s8 mapNum, s8 warpId, s8 void SetWarpDestinationToDynamicWarp(u8 unusedWarpId); void SetWarpDestinationToHealLocation(u8 healLocationId); void SetWarpDestinationToLastHealLocation(void); +void SetWarpDestinationForTeleport(void); void SetLastHealLocationWarp(u8 healLocationId); void UpdateEscapeWarp(s16 x, s16 y); void SetEscapeWarp(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y); diff --git a/src/field_effect.c b/src/field_effect.c index 174c071ae4..9127e6b0ea 100644 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -2659,7 +2659,7 @@ static void TeleportWarpOutFieldEffect_End(struct Task *task) if (BGMusicStopped() == TRUE) { - SetWarpDestinationToLastHealLocation(); + SetWarpDestinationForTeleport(); WarpIntoMap(); SetMainCallback2(CB2_LoadMap); gFieldCallback = FieldCallback_TeleportWarpIn; diff --git a/src/heal_location.c b/src/heal_location.c index fd376e71e0..d7854dbf75 100644 --- a/src/heal_location.c +++ b/src/heal_location.c @@ -79,7 +79,7 @@ bool32 IsLastHealLocationPlayerHouse() u32 GetHealNpcLocalId(u32 healLocationId) { if (healLocationId == HEAL_LOCATION_NONE || healLocationId >= NUM_HEAL_LOCATIONS) - return 0; + return LOCALID_NONE; return sWhiteoutRespawnHealerNpcIds[healLocationId - 1]; } diff --git a/src/overworld.c b/src/overworld.c index ec66acaad8..3c0430a168 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -715,7 +715,7 @@ static bool32 IsWhiteoutCutscene(void) { if (OW_WHITEOUT_CUTSCENE < GEN_4) return FALSE; - return GetHealNpcLocalId(GetHealLocationIndexByWarpData(&gSaveBlock1Ptr->lastHealLocation)) > 0; + return GetHealNpcLocalId(GetHealLocationIndexByWarpData(&gSaveBlock1Ptr->lastHealLocation)) != LOCALID_NONE; } void SetWarpDestinationToLastHealLocation(void) @@ -726,6 +726,11 @@ void SetWarpDestinationToLastHealLocation(void) sWarpDestination = gSaveBlock1Ptr->lastHealLocation; } +void SetWarpDestinationForTeleport(void) +{ + sWarpDestination = gSaveBlock1Ptr->lastHealLocation; +} + void SetLastHealLocationWarp(u8 healLocationId) { const struct HealLocation *healLocation = GetHealLocation(healLocationId);