Fix specific tiles changing to pc tiles when using boxlink/debug pc (#5141)
This commit is contained in:
parent
5df53a5c1c
commit
ba1512f864
2 changed files with 19 additions and 6 deletions
|
@ -7,4 +7,7 @@ extern const u16 gTilesetPalettes_General[][16];
|
||||||
extern const struct Tileset * const gTilesetPointer_SecretBase;
|
extern const struct Tileset * const gTilesetPointer_SecretBase;
|
||||||
extern const struct Tileset * const gTilesetPointer_SecretBaseRedCave;
|
extern const struct Tileset * const gTilesetPointer_SecretBaseRedCave;
|
||||||
|
|
||||||
|
extern const struct Tileset gTileset_Building;
|
||||||
|
extern const struct Tileset gTileset_BrendansMaysHouse;
|
||||||
|
|
||||||
#endif //GUARD_tilesets_H
|
#endif //GUARD_tilesets_H
|
||||||
|
|
|
@ -44,6 +44,7 @@
|
||||||
#include "strings.h"
|
#include "strings.h"
|
||||||
#include "task.h"
|
#include "task.h"
|
||||||
#include "text.h"
|
#include "text.h"
|
||||||
|
#include "tilesets.h"
|
||||||
#include "tv.h"
|
#include "tv.h"
|
||||||
#include "wallclock.h"
|
#include "wallclock.h"
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
|
@ -969,6 +970,20 @@ void FieldShowRegionMap(void)
|
||||||
SetMainCallback2(CB2_FieldShowRegionMap);
|
SetMainCallback2(CB2_FieldShowRegionMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool32 IsBuildingPCTile(u32 tileId)
|
||||||
|
{
|
||||||
|
return gMapHeader.mapLayout->primaryTileset == &gTileset_Building && (tileId == METATILE_Building_PC_On || tileId == METATILE_Building_PC_Off);
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool32 IsPlayerHousePCTile(u32 tileId)
|
||||||
|
{
|
||||||
|
return gMapHeader.mapLayout->secondaryTileset == &gTileset_BrendansMaysHouse
|
||||||
|
&& (tileId == METATILE_BrendansMaysHouse_BrendanPC_On
|
||||||
|
|| tileId == METATILE_BrendansMaysHouse_BrendanPC_Off
|
||||||
|
|| tileId == METATILE_BrendansMaysHouse_MayPC_On
|
||||||
|
|| tileId == METATILE_BrendansMaysHouse_MayPC_Off);
|
||||||
|
}
|
||||||
|
|
||||||
static bool8 IsPlayerInFrontOfPC(void)
|
static bool8 IsPlayerInFrontOfPC(void)
|
||||||
{
|
{
|
||||||
s16 x, y;
|
s16 x, y;
|
||||||
|
@ -977,12 +992,7 @@ static bool8 IsPlayerInFrontOfPC(void)
|
||||||
GetXYCoordsOneStepInFrontOfPlayer(&x, &y);
|
GetXYCoordsOneStepInFrontOfPlayer(&x, &y);
|
||||||
tileInFront = MapGridGetMetatileIdAt(x, y);
|
tileInFront = MapGridGetMetatileIdAt(x, y);
|
||||||
|
|
||||||
return (tileInFront == METATILE_BrendansMaysHouse_BrendanPC_On
|
return IsBuildingPCTile(tileInFront) || IsPlayerHousePCTile(tileInFront);
|
||||||
|| tileInFront == METATILE_BrendansMaysHouse_BrendanPC_Off
|
|
||||||
|| tileInFront == METATILE_BrendansMaysHouse_MayPC_On
|
|
||||||
|| tileInFront == METATILE_BrendansMaysHouse_MayPC_Off
|
|
||||||
|| tileInFront == METATILE_Building_PC_On
|
|
||||||
|| tileInFront == METATILE_Building_PC_Off);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Task data for Task_PCTurnOnEffect and Task_LotteryCornerComputerEffect
|
// Task data for Task_PCTurnOnEffect and Task_LotteryCornerComputerEffect
|
||||||
|
|
Loading…
Reference in a new issue