From a9ab3286efb063afd4304ac2187e6b778a76482b Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sun, 25 Sep 2022 05:51:08 -0300 Subject: [PATCH 1/2] Fixed IsPlayerInFrontOfPC --- src/field_specials.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/field_specials.c b/src/field_specials.c index 040a7a86f..dcf89487c 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -961,9 +961,9 @@ static bool8 IsPlayerInFrontOfPC(void) GetXYCoordsOneStepInFrontOfPlayer(&x, &y); tileInFront = MapGridGetMetatileIdAt(x, y); - return (tileInFront == METATILE_BrendansMaysHouse_BrendanPC_Off - || tileInFront == METATILE_BrendansMaysHouse_MayPC_Off - || tileInFront == METATILE_Building_PC_Off); + return ((tileInFront == METATILE_BrendansMaysHouse_BrendanPC_On || 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)); } void DoPCTurnOnEffect(void) From 3b983aae147fdd9788d7ffce62a46f953e19d96b Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Sun, 25 Sep 2022 08:31:24 -0300 Subject: [PATCH 2/2] Apply suggestions from code review --- src/field_specials.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/field_specials.c b/src/field_specials.c index dcf89487c..ac9c5d58c 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -961,9 +961,12 @@ static bool8 IsPlayerInFrontOfPC(void) GetXYCoordsOneStepInFrontOfPlayer(&x, &y); tileInFront = MapGridGetMetatileIdAt(x, y); - return ((tileInFront == METATILE_BrendansMaysHouse_BrendanPC_On || 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)); + return (tileInFront == METATILE_BrendansMaysHouse_BrendanPC_On + || 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); } void DoPCTurnOnEffect(void)