mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 19:54:21 +01:00
Merge pull request #2356 from LOuroboros/PeeC
Modified the debug menu's PC access
This commit is contained in:
commit
13573b6e53
@ -2805,9 +2805,8 @@ static void Task_WaitFadeAccessPC(u8 taskId)
|
||||
static void DebugAction_AccessPC(u8 taskId)
|
||||
{
|
||||
Debug_DestroyMenu_Full(taskId);
|
||||
CleanupOverworldWindowsAndTilemaps();
|
||||
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
|
||||
CreateTask(Task_WaitFadeAccessPC, 0);
|
||||
LockPlayerFieldControls();
|
||||
ScriptContext_SetupScript(EventScript_PC);
|
||||
}
|
||||
|
||||
|
||||
|
@ -953,9 +953,22 @@ void FieldShowRegionMap(void)
|
||||
SetMainCallback2(CB2_FieldShowRegionMap);
|
||||
}
|
||||
|
||||
static bool8 IsPlayerInFrontOfPC(void)
|
||||
{
|
||||
u16 x, y;
|
||||
u16 tileInFront;
|
||||
|
||||
GetXYCoordsOneStepInFrontOfPlayer(&x, &y);
|
||||
tileInFront = MapGridGetMetatileIdAt(x, y);
|
||||
|
||||
return (tileInFront == METATILE_BrendansMaysHouse_BrendanPC_Off
|
||||
|| tileInFront == METATILE_BrendansMaysHouse_MayPC_Off
|
||||
|| tileInFront == METATILE_Building_PC_Off);
|
||||
}
|
||||
|
||||
void DoPCTurnOnEffect(void)
|
||||
{
|
||||
if (FuncIsActiveTask(Task_PCTurnOnEffect) != TRUE)
|
||||
if (FuncIsActiveTask(Task_PCTurnOnEffect) != TRUE && IsPlayerInFrontOfPC() == TRUE)
|
||||
{
|
||||
u8 taskId = CreateTask(Task_PCTurnOnEffect, 8);
|
||||
gTasks[taskId].data[0] = 0;
|
||||
@ -1041,6 +1054,9 @@ static void PCTurnOffEffect(void)
|
||||
s8 dy = 0;
|
||||
u16 tileId = 0;
|
||||
u8 playerDirection = GetPlayerFacingDirection();
|
||||
|
||||
if (IsPlayerInFrontOfPC() == TRUE)
|
||||
return;
|
||||
switch (playerDirection)
|
||||
{
|
||||
case DIR_NORTH:
|
||||
|
Loading…
Reference in New Issue
Block a user