summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcbt6 <91667135+cbt6@users.noreply.github.com>2022-02-23 15:07:22 +0800
committercbt6 <91667135+cbt6@users.noreply.github.com>2022-02-23 15:07:22 +0800
commitf826a5a82d3563cf30f7acd5270f200119cc6745 (patch)
tree712c9ace5ed9c462d1d9e1b85b3e68dbde425344
parent3765c1e7f155ce42b5808117e97bf287e7006d6d (diff)
Use constants for PC locations
-rw-r--r--data/maps/LittlerootTown_BrendansHouse_2F/scripts.inc4
-rw-r--r--data/maps/LittlerootTown_MaysHouse_2F/scripts.inc4
-rw-r--r--data/scripts/pc.inc4
-rw-r--r--src/field_specials.c6
4 files changed, 9 insertions, 9 deletions
diff --git a/data/maps/LittlerootTown_BrendansHouse_2F/scripts.inc b/data/maps/LittlerootTown_BrendansHouse_2F/scripts.inc
index 901940ab8..cd4d15519 100644
--- a/data/maps/LittlerootTown_BrendansHouse_2F/scripts.inc
+++ b/data/maps/LittlerootTown_BrendansHouse_2F/scripts.inc
@@ -243,7 +243,7 @@ LittlerootTown_BrendansHouse_2F_EventScript_PC::
end
LittlerootTown_BrendansHouse_2F_EventScript_CheckPlayersPC::
- setvar VAR_0x8004, 1
+ setvar VAR_0x8004, PC_LOCATION_BRENDANS_HOUSE
special DoPCTurnOnEffect
playse SE_PC_ON
msgbox gText_PlayerHouseBootPC, MSGBOX_DEFAULT
@@ -253,7 +253,7 @@ LittlerootTown_BrendansHouse_2F_EventScript_CheckPlayersPC::
end
LittlerootTown_BrendansHouse_2F_EventScript_TurnOffPlayerPC::
- setvar VAR_0x8004, 1
+ setvar VAR_0x8004, PC_LOCATION_BRENDANS_HOUSE
playse SE_PC_OFF
special DoPCTurnOffEffect
releaseall
diff --git a/data/maps/LittlerootTown_MaysHouse_2F/scripts.inc b/data/maps/LittlerootTown_MaysHouse_2F/scripts.inc
index 7403f3fcf..ef8e83bf7 100644
--- a/data/maps/LittlerootTown_MaysHouse_2F/scripts.inc
+++ b/data/maps/LittlerootTown_MaysHouse_2F/scripts.inc
@@ -294,7 +294,7 @@ LittlerootTown_MaysHouse_2F_EventScript_CheckRivalsPC::
end
LittlerootTown_MaysHouse_2F_EventScript_CheckPlayersPC::
- setvar VAR_0x8004, 2
+ setvar VAR_0x8004, PC_LOCATION_MAYS_HOUSE
special DoPCTurnOnEffect
playse SE_PC_ON
msgbox gText_PlayerHouseBootPC, MSGBOX_DEFAULT
@@ -304,7 +304,7 @@ LittlerootTown_MaysHouse_2F_EventScript_CheckPlayersPC::
end
LittlerootTown_MaysHouse_2F_EventScript_TurnOffPlayerPC::
- setvar VAR_0x8004, 2
+ setvar VAR_0x8004, PC_LOCATION_MAYS_HOUSE
playse SE_PC_OFF
special DoPCTurnOffEffect
releaseall
diff --git a/data/scripts/pc.inc b/data/scripts/pc.inc
index 43c0bca0d..1993aaf63 100644
--- a/data/scripts/pc.inc
+++ b/data/scripts/pc.inc
@@ -1,6 +1,6 @@
EventScript_PC::
lockall
- setvar VAR_0x8004, 0
+ setvar VAR_0x8004, PC_LOCATION_OTHER
special DoPCTurnOnEffect
playse SE_PC_ON
msgbox Text_BootUpPC, MSGBOX_DEFAULT
@@ -51,7 +51,7 @@ EventScript_AccessLanettesPC::
return
EventScript_TurnOffPC::
- setvar VAR_0x8004, 0
+ setvar VAR_0x8004, PC_LOCATION_OTHER
playse SE_PC_OFF
special DoPCTurnOffEffect
releaseall
diff --git a/src/field_specials.c b/src/field_specials.c
index f749ea8fc..a4cdafafc 100644
--- a/src/field_specials.c
+++ b/src/field_specials.c
@@ -1069,11 +1069,11 @@ static void PCTurnOffEffect(void)
dy = -1;
break;
}
- if (gSpecialVar_0x8004 == 0)
+ if (gSpecialVar_0x8004 == PC_LOCATION_OTHER)
tileId = METATILE_Building_PC_Off;
- else if (gSpecialVar_0x8004 == 1)
+ else if (gSpecialVar_0x8004 == PC_LOCATION_BRENDANS_HOUSE)
tileId = METATILE_BrendansMaysHouse_BrendanPC_Off;
- else if (gSpecialVar_0x8004 == 2)
+ else if (gSpecialVar_0x8004 == PC_LOCATION_MAYS_HOUSE)
tileId = METATILE_BrendansMaysHouse_MayPC_Off;
MapGridSetMetatileIdAt(gSaveBlock1Ptr->pos.x + dx + MAP_OFFSET, gSaveBlock1Ptr->pos.y + dy + MAP_OFFSET, tileId | MAPGRID_COLLISION_MASK);
DrawWholeMapView();