fix pc spawning on specific tiles when using boxlink/debug pc access

This commit is contained in:
cawtds
2024-08-11 22:06:40 +02:00
parent de72056f0d
commit 8072cfe7af
2 changed files with 6 additions and 4 deletions

View File

@@ -10,4 +10,7 @@ extern const u16 gTilesetPalettes_GenericBuilding1[][16];
extern const u32 gTilesetTiles_DepartmentStore[];
extern const u16 gTilesetPalettes_DepartmentStore[][16];
extern const struct Tileset gTileset_PokemonCenter;
extern const struct Tileset gTileset_GenericBuilding1;
#endif // GUARD_TILESETS_H

View File

@@ -36,6 +36,7 @@
#include "naming_screen.h"
#include "party_menu.h"
#include "rtc.h"
#include "tilesets.h"
#include "wallclock.h"
#include "dynamic_placeholder_text_util.h"
#include "new_menu_helpers.h"
@@ -237,10 +238,8 @@ static bool8 IsPlayerInFrontOfPC(void)
GetXYCoordsOneStepInFrontOfPlayer(&x, &y);
tileInFront = MapGridGetMetatileIdAt(x, y);
return (tileInFront == METATILE_Building_PCOff
|| tileInFront == METATILE_Building_PCOn
|| tileInFront == METATILE_GenericBuilding1_PlayersPCOff
|| tileInFront == METATILE_GenericBuilding1_PlayersPCOn);
return (gMapHeader.mapLayout->secondaryTileset == &gTileset_PokemonCenter && (tileInFront == METATILE_Building_PCOn || tileInFront == METATILE_Building_PCOff))
|| (gMapHeader.mapLayout->secondaryTileset == &gTileset_GenericBuilding1 && (tileInFront == METATILE_GenericBuilding1_PlayersPCOn || tileInFront == METATILE_GenericBuilding1_PlayersPCOff));
}
#define tState data[0]