From 449fb25f2372c8d51fc156d0eeeffa4023ec38b8 Mon Sep 17 00:00:00 2001 From: Diegoisawesome Date: Tue, 12 Feb 2019 00:40:34 -0600 Subject: [PATCH] Clear up misnamed time-based flags and functions --- asm/macros/event.inc | 2 +- data/event_scripts.s | 2 +- data/maps/LilycoveCity/scripts.inc | 2 +- data/maps/LilycoveCity_DepartmentStore_1F/scripts.inc | 2 +- data/maps/MossdeepCity_SpaceCenter_1F/scripts.inc | 4 ++-- data/maps/PacifidlogTown_House2/scripts.inc | 2 +- data/maps/Route104_PrettyPetalFlowerShop/scripts.inc | 2 +- data/maps/Route111/scripts.inc | 2 +- data/maps/Route114/scripts.inc | 2 +- data/maps/Route120/scripts.inc | 2 +- data/maps/Route123_BerryMastersHouse/scripts.inc | 4 ++-- data/maps/ShoalCave_LowTideEntranceRoom/scripts.inc | 2 +- data/maps/SootopolisCity/scripts.inc | 2 +- data/script_cmd_table.inc | 2 +- data/scripts/pokeblocks.inc | 4 ++-- include/event_data.h | 2 +- src/clock.c | 2 +- src/event_data.c | 7 +++---- src/scrcmd.c | 2 +- 19 files changed, 24 insertions(+), 25 deletions(-) diff --git a/asm/macros/event.inc b/asm/macros/event.inc index 091c32a2a..fa0b3fa06 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -313,7 +313,7 @@ .endm @ Runs time based events. In FireRed, this command is a nop. - .macro dodailyevents + .macro dotimebasedevents .byte 0x2d .endm diff --git a/data/event_scripts.s b/data/event_scripts.s index fbee3987c..c1b71e5d4 100644 --- a/data/event_scripts.s +++ b/data/event_scripts.s @@ -1748,7 +1748,7 @@ RustboroCity_Gym_EventScript_271E84:: @ 8271E84 DewfordTown_EventScript_271E8B:: @ 8271E8B DewfordTown_Hall_EventScript_271E8B:: @ 8271E8B - dodailyevents + dotimebasedevents setvar VAR_0x8004, 0 special BufferTrendyPhraseString return diff --git a/data/maps/LilycoveCity/scripts.inc b/data/maps/LilycoveCity/scripts.inc index c1cec509f..cfa6b3867 100644 --- a/data/maps/LilycoveCity/scripts.inc +++ b/data/maps/LilycoveCity/scripts.inc @@ -33,7 +33,7 @@ LilycoveCity_EventScript_1E2B6B:: @ 81E2B6B LilycoveCity_EventScript_1E2BD8:: @ 81E2BD8 lock faceplayer - dodailyevents + dotimebasedevents goto_if_set FLAG_DAILY_LILYCOVE_RECEIVED_BERRY, LilycoveCity_EventScript_1E2C18 msgbox LilycoveCity_Text_2A7244, MSGBOX_DEFAULT random 10 diff --git a/data/maps/LilycoveCity_DepartmentStore_1F/scripts.inc b/data/maps/LilycoveCity_DepartmentStore_1F/scripts.inc index 2f8fcda3a..ffa2244f4 100644 --- a/data/maps/LilycoveCity_DepartmentStore_1F/scripts.inc +++ b/data/maps/LilycoveCity_DepartmentStore_1F/scripts.inc @@ -8,7 +8,7 @@ LilycoveCity_DepartmentStore_1F_EventScript_21F693:: @ 821F693 LilycoveCity_DepartmentStore_1F_EventScript_21F69C:: @ 821F69C lock faceplayer - dodailyevents + dotimebasedevents compare VAR_POKELOT_PRIZE, 0 goto_if_ne LilycoveCity_DepartmentStore_1F_EventScript_21F7F7 goto_if_set FLAG_DAILY_PICKED_LOTO_TICKET, LilycoveCity_DepartmentStore_1F_EventScript_21F78D diff --git a/data/maps/MossdeepCity_SpaceCenter_1F/scripts.inc b/data/maps/MossdeepCity_SpaceCenter_1F/scripts.inc index e875be96f..6d9022065 100644 --- a/data/maps/MossdeepCity_SpaceCenter_1F/scripts.inc +++ b/data/maps/MossdeepCity_SpaceCenter_1F/scripts.inc @@ -52,7 +52,7 @@ MossdeepCity_SpaceCenter_1F_EventScript_222FD8:: @ 8222FD8 faceplayer compare VAR_0x405D, 2 goto_if_eq MossdeepCity_SpaceCenter_1F_EventScript_223024 - dodailyevents + dotimebasedevents specialvar VAR_RESULT, GetWeekCount buffernumberstring 0, VAR_RESULT compare VAR_RESULT, 0 @@ -74,7 +74,7 @@ MossdeepCity_SpaceCenter_1F_EventScript_22301B:: @ 822301B return MossdeepCity_SpaceCenter_1F_EventScript_223024:: @ 8223024 - dodailyevents + dotimebasedevents specialvar VAR_RESULT, GetWeekCount buffernumberstring 0, VAR_RESULT compare VAR_RESULT, 0 diff --git a/data/maps/PacifidlogTown_House2/scripts.inc b/data/maps/PacifidlogTown_House2/scripts.inc index b3078fa2d..c7c04c0bd 100644 --- a/data/maps/PacifidlogTown_House2/scripts.inc +++ b/data/maps/PacifidlogTown_House2/scripts.inc @@ -4,7 +4,7 @@ PacifidlogTown_House2_MapScripts:: @ 8203791 PacifidlogTown_House2_EventScript_203792:: @ 8203792 lock faceplayer - dodailyevents + dotimebasedevents call PacifidlogTown_House2_EventScript_2037DE goto_if_set FLAG_RECEIVED_FANCLUB_TM_THIS_WEEK, PacifidlogTown_House2_EventScript_20387E call_if_set FLAG_MET_FANCLUB_YOUNGER_BROTHER, PacifidlogTown_House2_EventScript_2037F8 diff --git a/data/maps/Route104_PrettyPetalFlowerShop/scripts.inc b/data/maps/Route104_PrettyPetalFlowerShop/scripts.inc index e9af43d73..7f5e35287 100644 --- a/data/maps/Route104_PrettyPetalFlowerShop/scripts.inc +++ b/data/maps/Route104_PrettyPetalFlowerShop/scripts.inc @@ -84,7 +84,7 @@ Route104_PrettyPetalFlowerShop_EventScript_22A421:: @ 822A421 Route104_PrettyPetalFlowerShop_EventScript_22A442:: @ 822A442 lock faceplayer - dodailyevents + dotimebasedevents goto_if_set FLAG_DAILY_FLOWER_SHOP_RECEIVED_BERRY, Route104_PrettyPetalFlowerShop_EventScript_22A482 msgbox Route104_PrettyPetalFlowerShop_Text_2A7A98, MSGBOX_DEFAULT random 8 diff --git a/data/maps/Route111/scripts.inc b/data/maps/Route111/scripts.inc index 75de7dce7..74ee42c64 100644 --- a/data/maps/Route111/scripts.inc +++ b/data/maps/Route111/scripts.inc @@ -159,7 +159,7 @@ Route111_Movement_1F0EB1:: @ 81F0EB1 Route111_EventScript_1F0EB9:: @ 81F0EB9 lock faceplayer - dodailyevents + dotimebasedevents goto_if_set FLAG_DAILY_ROUTE_111_RECEIVED_BERRY, Route111_EventScript_1F0EF4 msgbox Route111_Text_2A6EBD, MSGBOX_DEFAULT giveitem_std ITEM_RAZZ_BERRY diff --git a/data/maps/Route114/scripts.inc b/data/maps/Route114/scripts.inc index 8f0c1c6ac..cccc8de5f 100644 --- a/data/maps/Route114/scripts.inc +++ b/data/maps/Route114/scripts.inc @@ -27,7 +27,7 @@ Route114_MapScript2_1F2578: @ 81F2578 Route114_EventScript_1F2582:: @ 81F2582 lock faceplayer - dodailyevents + dotimebasedevents goto_if_set FLAG_DAILY_ROUTE_114_RECEIVED_BERRY, Route114_EventScript_1F25C7 msgbox Route114_Text_2A6FCB, MSGBOX_DEFAULT random 5 diff --git a/data/maps/Route120/scripts.inc b/data/maps/Route120/scripts.inc index cd864e1dc..a66026283 100644 --- a/data/maps/Route120/scripts.inc +++ b/data/maps/Route120/scripts.inc @@ -98,7 +98,7 @@ Route120_EventScript_1F5523:: @ 81F5523 Route120_EventScript_1F5527:: @ 81F5527 lock faceplayer - dodailyevents + dotimebasedevents goto_if_set FLAG_DAILY_ROUTE_120_RECEIVED_BERRY, Route120_EventScript_1F5625 msgbox Route120_Text_2A70C7, MSGBOX_YESNO compare VAR_RESULT, 1 diff --git a/data/maps/Route123_BerryMastersHouse/scripts.inc b/data/maps/Route123_BerryMastersHouse/scripts.inc index a3ae5df93..a7175e698 100644 --- a/data/maps/Route123_BerryMastersHouse/scripts.inc +++ b/data/maps/Route123_BerryMastersHouse/scripts.inc @@ -9,7 +9,7 @@ Route123_BerryMastersHouse_MapScript1_26F841: @ 826F841 Route123_BerryMastersHouse_EventScript_26F845:: @ 826F845 lock faceplayer - dodailyevents + dotimebasedevents goto_if_set FLAG_DAILY_BERRY_MASTER_RECEIVED_BERRY, Route123_BerryMastersHouse_EventScript_26F8B6 msgbox Route123_BerryMastersHouse_Text_2A7386, MSGBOX_DEFAULT random 10 @@ -38,7 +38,7 @@ Route123_BerryMastersHouse_EventScript_26F8B6:: @ 826F8B6 Route123_BerryMastersHouse_EventScript_26F8C0:: @ 826F8C0 lock faceplayer - dodailyevents + dotimebasedevents goto_if_set FLAG_DAILY_BERRY_MASTERS_WIFE, Route123_BerryMastersHouse_EventScript_26FA6F msgbox Route123_BerryMastersHouse_Text_2A74E6, MSGBOX_DEFAULT setvar VAR_0x8004, 13 diff --git a/data/maps/ShoalCave_LowTideEntranceRoom/scripts.inc b/data/maps/ShoalCave_LowTideEntranceRoom/scripts.inc index 6e0f4eddb..2874da963 100644 --- a/data/maps/ShoalCave_LowTideEntranceRoom/scripts.inc +++ b/data/maps/ShoalCave_LowTideEntranceRoom/scripts.inc @@ -18,7 +18,7 @@ ShoalCave_LowTideEntranceRoom_EventScript_236DD5:: @ 8236DD5 ShoalCave_LowTideEntranceRoom_EventScript_236DD9:: @ 8236DD9 lock faceplayer - dodailyevents + dotimebasedevents call_if_set FLAG_SYS_SHOAL_ITEM, ShoalCave_LowTideEntranceRoom_EventScript_236ED9 checkitem ITEM_SHOAL_SALT, 4 compare VAR_RESULT, 0 diff --git a/data/maps/SootopolisCity/scripts.inc b/data/maps/SootopolisCity/scripts.inc index 5e212ddfe..9d554f8eb 100644 --- a/data/maps/SootopolisCity/scripts.inc +++ b/data/maps/SootopolisCity/scripts.inc @@ -742,7 +742,7 @@ SootopolisCity_EventScript_1E5F10:: @ 81E5F10 end SootopolisCity_EventScript_1E5F1B:: @ 81E5F1B - dodailyevents + dotimebasedevents special GetPlayerBigGuyGirlString goto_if_set FLAG_DAILY_SOOTOPOLIS_RECEIVED_BERRY, SootopolisCity_EventScript_1E5FBB msgbox SootopolisCity_Text_2A7BB0, MSGBOX_DEFAULT diff --git a/data/script_cmd_table.inc b/data/script_cmd_table.inc index 07b22dda2..39864b2a8 100644 --- a/data/script_cmd_table.inc +++ b/data/script_cmd_table.inc @@ -45,7 +45,7 @@ gScriptCmdTable:: @ 81DB67C .4byte ScrCmd_clearflag .4byte ScrCmd_checkflag .4byte ScrCmd_initclock - .4byte ScrCmd_dodailyevents + .4byte ScrCmd_dotimebasedevents .4byte ScrCmd_gettime .4byte ScrCmd_playse .4byte ScrCmd_waitse diff --git a/data/scripts/pokeblocks.inc b/data/scripts/pokeblocks.inc index 05b468e23..c2a580a61 100644 --- a/data/scripts/pokeblocks.inc +++ b/data/scripts/pokeblocks.inc @@ -264,7 +264,7 @@ EventScript_Pblock1_No: @ 8293C70 EventScript_Pblock1_NoBerries: @ 8293C7A msgbox Text_Pblock1_NoBerries, MSGBOX_DEFAULT - dodailyevents + dotimebasedevents goto_if_set FLAG_DAILY_CONTEST_LOBBY_RECEIVED_BERRY, LilycoveCity_ContestLobby_EventScript_293C92 goto LilycoveCity_ContestLobby_EventScript_293C9C end @@ -551,7 +551,7 @@ LilycoveCity_ContestLobby_EventScript_293FF8: @ 8293FF8 specialvar VAR_RESULT, GetFirstFreePokeblockSlot compare VAR_RESULT, 65535 goto_if_eq LilycoveCity_ContestLobby_EventScript_294028 - dodailyevents + dotimebasedevents goto_if_set FLAG_DAILY_CONTEST_LOBBY_RECEIVED_BERRY, LilycoveCity_ContestLobby_EventScript_294028 goto LilycoveCity_ContestLobby_EventScript_294032 end diff --git a/include/event_data.h b/include/event_data.h index e09b32d44..3b8e2701f 100644 --- a/include/event_data.h +++ b/include/event_data.h @@ -6,7 +6,7 @@ void InitEventData(void); void ClearTempFieldEventData(void); -void ClearUpperFlags(void); +void ClearDailyFlags(void); void DisableNationalPokedex(void); void EnableNationalPokedex(void); bool32 IsNationalPokedexEnabled(void); diff --git a/src/clock.c b/src/clock.c index d52fde22e..1e7c5f83e 100644 --- a/src/clock.c +++ b/src/clock.c @@ -41,7 +41,7 @@ static void UpdatePerDay(struct Time *localTime) if (*days != localTime->days && *days <= localTime->days) { daysSince = localTime->days - *days; - ClearUpperFlags(); + ClearDailyFlags(); UpdateDewfordTrendPerDay(daysSince); UpdateTVShowsPerDay(daysSince); UpdateWeatherPerDay(daysSince); diff --git a/src/event_data.c b/src/event_data.c index df289c538..a9da142e5 100644 --- a/src/event_data.c +++ b/src/event_data.c @@ -3,7 +3,7 @@ #include "pokedex.h" #define TEMP_FLAGS_SIZE 0x4 -#define TEMP_UPPER_FLAGS_SIZE 0x8 +#define DAILY_FLAGS_SIZE 0x8 #define TEMP_VARS_SIZE 0x20 EWRAM_DATA u16 gSpecialVar_0x8000 = 0; @@ -48,10 +48,9 @@ void ClearTempFieldEventData(void) FlagClear(FLAG_NURSE_UNION_ROOM_REMINDER); } -// Probably had different flag splits at one point. -void ClearUpperFlags(void) +void ClearDailyFlags(void) { - memset(gSaveBlock1Ptr->flags + 0x124, 0, TEMP_UPPER_FLAGS_SIZE); + memset(gSaveBlock1Ptr->flags + 0x124, 0, DAILY_FLAGS_SIZE); } void DisableNationalPokedex(void) diff --git a/src/scrcmd.c b/src/scrcmd.c index 837259a7f..51d96ff2e 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -690,7 +690,7 @@ bool8 ScrCmd_initclock(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_dodailyevents(struct ScriptContext *ctx) +bool8 ScrCmd_dotimebasedevents(struct ScriptContext *ctx) { DoTimeBasedEvents(); return FALSE;