Fix teleport location (#8941)

This commit is contained in:
cawtds 2026-01-17 15:48:45 +01:00 committed by GitHub
parent b84229ee19
commit 7b03c2e238
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 9 additions and 3 deletions

View File

@ -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);

View File

@ -2659,7 +2659,7 @@ static void TeleportWarpOutFieldEffect_End(struct Task *task)
if (BGMusicStopped() == TRUE)
{
SetWarpDestinationToLastHealLocation();
SetWarpDestinationForTeleport();
WarpIntoMap();
SetMainCallback2(CB2_LoadMap);
gFieldCallback = FieldCallback_TeleportWarpIn;

View File

@ -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];
}

View File

@ -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);