diff --git a/data/maps/SecretBase_YellowCave4/scripts.inc b/data/maps/SecretBase_YellowCave4/scripts.inc index 40f1e5a15..805d7e299 100644 --- a/data/maps/SecretBase_YellowCave4/scripts.inc +++ b/data/maps/SecretBase_YellowCave4/scripts.inc @@ -16,7 +16,7 @@ SecretBase_RedCave1_MapScript1_23B4A2: @ 823B4A2 end SecretBase_RedCave1_MapScript2_23B4AE: @ 823B4AE - map_script_2 VAR_SECRET_BASE_SHOULD_BE_INIT, 0, SecretBase_RedCave1_EventScript_275B81 + map_script_2 VAR_INIT_SECRET_BASE, 0, SecretBase_RedCave1_EventScript_275B81 .2byte 0 SecretBase_RedCave1_MapScript1_23B4B8: @ 823B4B8 diff --git a/data/scripts/secret_base.inc b/data/scripts/secret_base.inc index 95e9a2fc5..6302a33a8 100644 --- a/data/scripts/secret_base.inc +++ b/data/scripts/secret_base.inc @@ -430,7 +430,7 @@ EventScript_275B4D:: @ 8275B4D EventScript_275B5B:: @ 8275B5B closemessage playse SE_KAIDAN - setvar VAR_SECRET_BASE_SHOULD_BE_INIT, 0 + setvar VAR_INIT_SECRET_BASE, 0 setflag FLAG_DECORATION_0 special sub_80E8E18 special sub_80E9068 @@ -444,7 +444,7 @@ EventScript_275B5B:: @ 8275B5B SecretBase_RedCave1_EventScript_275B81:: @ 8275B81 applymovement EVENT_OBJ_ID_PLAYER, SecretBase_RedCave1_Movement_275BB4 waitmovement 0 - setvar VAR_SECRET_BASE_SHOULD_BE_INIT, 1 + setvar VAR_INIT_SECRET_BASE, 1 msgbox SecretBase_RedCave1_Text_23B759, MSGBOX_YESNO compare VAR_RESULT, 1 goto_if_eq SecretBase_RedCave1_EventScript_275BAB @@ -467,7 +467,7 @@ SecretBase_RedCave1_Movement_275BB4: @ 8275BB4 EventScript_275BB7:: @ 8275BB7 lockall - setvar VAR_SECRET_BASE_SHOULD_BE_INIT, 1 + setvar VAR_INIT_SECRET_BASE, 1 playse SE_KAIDAN special sub_80E9744 compare VAR_RESULT, 0 diff --git a/include/constants/vars.h b/include/constants/vars.h index 72b02ee8f..c025d62fc 100644 --- a/include/constants/vars.h +++ b/include/constants/vars.h @@ -167,7 +167,7 @@ #define VAR_LILYCOVE_MUSEUM_2F_STATE 0x4094 #define VAR_LILYCOVE_FAN_CLUB_STATE 0x4095 #define VAR_BRINEY_LOCATION 0x4096 -#define VAR_SECRET_BASE_SHOULD_BE_INIT 0x4097 +#define VAR_INIT_SECRET_BASE 0x4097 #define VAR_PETALBURG_WOODS_STATE 0x4098 #define VAR_LILYCOVE_CONTEST_LOBBY_STATE 0x4099 #define VAR_RUSTURF_TUNNEL_STATE 0x409A diff --git a/include/main.h b/include/main.h index 014b4942e..2c241bf97 100644 --- a/include/main.h +++ b/include/main.h @@ -61,8 +61,8 @@ void SetHBlankCallback(IntrCallback callback); void SetVCountCallback(IntrCallback callback); void SetSerialCallback(IntrCallback callback); void InitFlashTimer(void); -void SetVBlankCounterPointer(u32 *var); -void ClearVBlankCounterPointer(void); +void SetTrainerHillVBlankCounter(u32 *var); +void ClearTrainerHillVBlankCounter(void); void DoSoftReset(void); void ClearPokemonCrySongs(void); void RestoreSerialTimer3IntrHandlers(void); diff --git a/include/overworld.h b/include/overworld.h index 54715ecc0..7ca442957 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -96,7 +96,7 @@ u8 GetMapTypeByGroupAndId(s8 mapGroup, s8 mapNum); u8 GetMapTypeByWarpData(struct WarpData *warp); u8 GetCurrentMapType(void); u8 GetLastUsedWarpMapType(void); -bool8 IsMapTypeOutside(u8 mapType); +bool8 IsMapTypeOutdoors(u8 mapType); bool8 Overworld_MapTypeAllowsTeleportAndFly(u8 mapType); bool8 Overworld_MapTypeIsIndoors(u8 mapType); u8 GetSavedWarpRegionMapSectionId(void); diff --git a/include/trainer_hill.h b/include/trainer_hill.h index 35b0c5d6d..ad2713316 100644 --- a/include/trainer_hill.h +++ b/include/trainer_hill.h @@ -1,7 +1,7 @@ #ifndef GUARD_TRAINER_HILL_H #define GUARD_TRAINER_HILL_H -extern u32 *gVBlankCounterPointer; +extern u32 *gTrainerHillVBlankCounter; void CallTrainerHillFunction(void); void ResetTrainerHillResults(void); diff --git a/src/field_effect.c b/src/field_effect.c index 74f7801bd..a4614b0a0 100644 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -2443,7 +2443,7 @@ static void sub_80B8410(struct Task *task) bool8 FldEff_FieldMoveShowMon(void) { u8 taskId; - if (IsMapTypeOutside(GetCurrentMapType()) == TRUE) + if (IsMapTypeOutdoors(GetCurrentMapType()) == TRUE) { taskId = CreateTask(sub_80B8554, 0xff); } else diff --git a/src/field_specials.c b/src/field_specials.c index e603c3ebf..20125d855 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -370,7 +370,7 @@ bool32 ShouldDoWallyCall(void) case MAP_TYPE_CITY: case MAP_TYPE_ROUTE: case MAP_TYPE_OCEAN_ROUTE: - if (++(*GetVarPointer(VAR_WALLY_CALL_STEP_COUNTER)) < 0xFA) + if (++(*GetVarPointer(VAR_WALLY_CALL_STEP_COUNTER)) < 250) { return FALSE; } @@ -451,7 +451,7 @@ bool32 ShouldDoRoxanneCall(void) case 2: case 3: case 6: - if (++(*GetVarPointer(VAR_ROXANNE_CALL_STEP_COUNTER)) < 0xFA) + if (++(*GetVarPointer(VAR_ROXANNE_CALL_STEP_COUNTER)) < 250) { return FALSE; } @@ -478,7 +478,7 @@ bool32 ShouldDoRivalRayquazaCall(void) case 2: case 3: case 6: - if (++(*GetVarPointer(VAR_RIVAL_RAYQUAZA_CALL_STEP_COUNTER)) < 0xFA) + if (++(*GetVarPointer(VAR_RIVAL_RAYQUAZA_CALL_STEP_COUNTER)) < 250) { return FALSE; } @@ -1516,7 +1516,7 @@ bool8 FoundBlackGlasses(void) void SetRoute119Weather(void) { - if (IsMapTypeOutside(GetLastUsedWarpMapType()) != TRUE) + if (IsMapTypeOutdoors(GetLastUsedWarpMapType()) != TRUE) { SetSav1Weather(20); } @@ -1524,7 +1524,7 @@ void SetRoute119Weather(void) void SetRoute123Weather(void) { - if (IsMapTypeOutside(GetLastUsedWarpMapType()) != TRUE) + if (IsMapTypeOutdoors(GetLastUsedWarpMapType()) != TRUE) { SetSav1Weather(21); } @@ -3428,21 +3428,21 @@ void CreateUnusualWeatherEvent(void) if (FlagGet(FLAG_DEFEATED_KYOGRE) == TRUE) { - VarSet(VAR_UNUSUAL_WEATHER_LOCATION, (randomValue & (UNUSUAL_WEATHER_COUNT_PER_LEGENDARY - 1)) + UNUSUAL_WEATHER_GROUDON_LOCATIONS_START); + VarSet(VAR_UNUSUAL_WEATHER_LOCATION, (randomValue % UNUSUAL_WEATHER_COUNT_PER_LEGENDARY) + UNUSUAL_WEATHER_GROUDON_LOCATIONS_START); } else if (FlagGet(FLAG_DEFEATED_GROUDON) == TRUE) { - VarSet(VAR_UNUSUAL_WEATHER_LOCATION, (randomValue & (UNUSUAL_WEATHER_COUNT_PER_LEGENDARY - 1)) + UNUSUAL_WEATHER_KYOGRE_LOCATIONS_START); + VarSet(VAR_UNUSUAL_WEATHER_LOCATION, (randomValue % UNUSUAL_WEATHER_COUNT_PER_LEGENDARY) + UNUSUAL_WEATHER_KYOGRE_LOCATIONS_START); } else if ((randomValue & 1) == 0) { randomValue = Random(); - VarSet(VAR_UNUSUAL_WEATHER_LOCATION, (randomValue & (UNUSUAL_WEATHER_COUNT_PER_LEGENDARY - 1)) + UNUSUAL_WEATHER_GROUDON_LOCATIONS_START); + VarSet(VAR_UNUSUAL_WEATHER_LOCATION, (randomValue % UNUSUAL_WEATHER_COUNT_PER_LEGENDARY) + UNUSUAL_WEATHER_GROUDON_LOCATIONS_START); } else { randomValue = Random(); - VarSet(VAR_UNUSUAL_WEATHER_LOCATION, (randomValue & (UNUSUAL_WEATHER_COUNT_PER_LEGENDARY - 1)) + UNUSUAL_WEATHER_KYOGRE_LOCATIONS_START); + VarSet(VAR_UNUSUAL_WEATHER_LOCATION, (randomValue % UNUSUAL_WEATHER_COUNT_PER_LEGENDARY) + UNUSUAL_WEATHER_KYOGRE_LOCATIONS_START); } } @@ -3450,7 +3450,24 @@ void CreateUnusualWeatherEvent(void) // returns TRUE if the weather is for Kyogre, and FALSE if it's for Groudon. bool32 GetUnusualWeatherMapNameAndType(void) { - static const u8 sUnusualWeatherMapNumbers[] = { 0x1d, 0x1d, 0x1e, 0x1e, 0x1f, 0x1f, 0x21, 0x21, 0x14, 0x14, 0x28, 0x28, 0x2a, 0x2a, 0x2c, 0x2c }; + static const u8 sUnusualWeatherMapNumbers[] = { + MAP_NUM(ROUTE114), + MAP_NUM(ROUTE114), + MAP_NUM(ROUTE115), + MAP_NUM(ROUTE115), + MAP_NUM(ROUTE116), + MAP_NUM(ROUTE116), + MAP_NUM(ROUTE118), + MAP_NUM(ROUTE118), + MAP_NUM(ROUTE105), + MAP_NUM(ROUTE105), + MAP_NUM(ROUTE125), + MAP_NUM(ROUTE125), + MAP_NUM(ROUTE127), + MAP_NUM(ROUTE127), + MAP_NUM(ROUTE129), + MAP_NUM(ROUTE129) + }; u16 unusualWeather = VarGet(VAR_UNUSUAL_WEATHER_LOCATION); @@ -3469,7 +3486,24 @@ bool32 GetUnusualWeatherMapNameAndType(void) bool8 UnusualWeatherHasExpired(void) { // Duplicate array. - static const u8 sUnusualWeatherMapNumbers_2[] = { 0x1d, 0x1d, 0x1e, 0x1e, 0x1f, 0x1f, 0x21, 0x21, 0x14, 0x14, 0x28, 0x28, 0x2a, 0x2a, 0x2c, 0x2c }; + static const u8 sUnusualWeatherMapNumbers_2[] = { + MAP_NUM(ROUTE114), + MAP_NUM(ROUTE114), + MAP_NUM(ROUTE115), + MAP_NUM(ROUTE115), + MAP_NUM(ROUTE116), + MAP_NUM(ROUTE116), + MAP_NUM(ROUTE118), + MAP_NUM(ROUTE118), + MAP_NUM(ROUTE105), + MAP_NUM(ROUTE105), + MAP_NUM(ROUTE125), + MAP_NUM(ROUTE125), + MAP_NUM(ROUTE127), + MAP_NUM(ROUTE127), + MAP_NUM(ROUTE129), + MAP_NUM(ROUTE129) + }; u16 steps = VarGet(VAR_UNUSUAL_WEATHER_STEP_COUNTER); u16 unusualWeather = VarGet(VAR_UNUSUAL_WEATHER_LOCATION); diff --git a/src/load_save.c b/src/load_save.c index d71e72802..7d307ec1b 100644 --- a/src/load_save.c +++ b/src/load_save.c @@ -99,7 +99,7 @@ void MoveSaveBlocks_ResetHeap(void) hblankCB = gMain.hblankCallback; gMain.vblankCallback = NULL; gMain.hblankCallback = NULL; - gVBlankCounterPointer = NULL; + gTrainerHillVBlankCounter = NULL; saveBlock2Copy = (struct SaveBlock2 *)(gHeap); saveBlock1Copy = (struct SaveBlock1 *)(gHeap + sizeof(struct SaveBlock2)); diff --git a/src/main.c b/src/main.c index 3e282775d..3049f4f90 100644 --- a/src/main.c +++ b/src/main.c @@ -163,7 +163,7 @@ static void UpdateLinkAndCallCallbacks(void) static void InitMainCallbacks(void) { gMain.vblankCounter1 = 0; - gVBlankCounterPointer = NULL; + gTrainerHillVBlankCounter = NULL; gMain.vblankCounter2 = 0; gMain.callback1 = NULL; SetMainCallback2(CB2_InitCopyrightScreenAfterBootup); @@ -324,8 +324,8 @@ static void VBlankIntr(void) gMain.vblankCounter1++; - if (gVBlankCounterPointer && *gVBlankCounterPointer < 0xFFFFFFFF) - (*gVBlankCounterPointer)++; + if (gTrainerHillVBlankCounter && *gTrainerHillVBlankCounter < 0xFFFFFFFF) + (*gTrainerHillVBlankCounter)++; if (gMain.vblankCallback) gMain.vblankCallback(); @@ -393,14 +393,14 @@ static void WaitForVBlank(void) ; } -void SetVBlankCounterPointer(u32 *var) +void SetTrainerHillVBlankCounter(u32 *counter) { - gVBlankCounterPointer = var; + gTrainerHillVBlankCounter = counter; } -void ClearVBlankCounterPointer(void) +void ClearTrainerHillVBlankCounter(void) { - gVBlankCounterPointer = NULL; + gTrainerHillVBlankCounter = NULL; } void DoSoftReset(void) diff --git a/src/overworld.c b/src/overworld.c index 84eb80a06..837855877 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -678,7 +678,7 @@ void UpdateEscapeWarp(s16 x, s16 y) { u8 currMapType = GetCurrentMapType(); u8 destMapType = GetMapTypeByGroupAndId(sWarpDestination.mapGroup, sWarpDestination.mapNum); - if (IsMapTypeOutside(currMapType) && IsMapTypeOutside(destMapType) != TRUE) + if (IsMapTypeOutdoors(currMapType) && IsMapTypeOutdoors(destMapType) != TRUE) SetEscapeWarp(gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1, x - 7, y - 6); } @@ -823,8 +823,8 @@ void LoadMapFromCameraTransition(u8 mapGroup, u8 mapNum) static void mli0_load_map(u32 a1) { - bool8 v2; - bool8 indoors; + bool8 isOutdoors; + bool8 isIndoors; LoadCurrentMapData(); if (!(sUnknown_020322D8 & 1)) @@ -837,8 +837,8 @@ static void mli0_load_map(u32 a1) LoadEventObjTemplatesFromHeader(); } - v2 = IsMapTypeOutside(gMapHeader.mapType); - indoors = Overworld_MapTypeIsIndoors(gMapHeader.mapType); + isOutdoors = IsMapTypeOutdoors(gMapHeader.mapType); + isIndoors = Overworld_MapTypeIsIndoors(gMapHeader.mapType); sub_80EB218(); TrySetMapSaveWarpStatus(); @@ -850,7 +850,7 @@ static void mli0_load_map(u32 a1) DoTimeBasedEvents(); SetSav1WeatherFromCurrMapHeader(); ChooseAmbientCrySpecies(); - if (v2) + if (isOutdoors) FlagClear(FLAG_SYS_USE_FLASH); SetDefaultFlashLevel(); Overworld_ClearSavedMusic(); @@ -864,7 +864,7 @@ static void mli0_load_map(u32 a1) else InitMap(); - if (a1 != 1 && indoors) + if (a1 != 1 && isIndoors) { UpdateTVScreensOnMap(gBackupMapLayout.width, gBackupMapLayout.height); sub_80E9238(1); @@ -1330,7 +1330,7 @@ u8 GetLastUsedWarpMapType(void) return GetMapTypeByWarpData(&gLastUsedWarp); } -bool8 IsMapTypeOutside(u8 mapType) +bool8 IsMapTypeOutdoors(u8 mapType) { if (mapType == MAP_TYPE_ROUTE || mapType == MAP_TYPE_TOWN diff --git a/src/save.c b/src/save.c index 593ee8f2c..920a5152a 100644 --- a/src/save.c +++ b/src/save.c @@ -659,10 +659,10 @@ static void UpdateSaveAddresses(void) u8 HandleSavingData(u8 saveType) { u8 i; - u32 *backupVar = gVBlankCounterPointer; + u32 *backupVar = gTrainerHillVBlankCounter; u8 *tempAddr; - gVBlankCounterPointer = NULL; + gTrainerHillVBlankCounter = NULL; UpdateSaveAddresses(); switch (saveType) { @@ -705,7 +705,7 @@ u8 HandleSavingData(u8 saveType) save_write_to_flash(0xFFFF, gRamSaveSectionLocations); break; } - gVBlankCounterPointer = backupVar; + gTrainerHillVBlankCounter = backupVar; return 0; } diff --git a/src/secret_base.c b/src/secret_base.c index cf35deb07..af8804ec3 100644 --- a/src/secret_base.c +++ b/src/secret_base.c @@ -60,7 +60,7 @@ struct SecretBaseRecordMixer { // Static RAM declarations EWRAM_DATA u8 sCurSecretBaseId = 0; -EWRAM_DATA bool8 gIsInSecretBase = FALSE; +EWRAM_DATA bool8 gInFriendSecretBase = FALSE; EWRAM_DATA struct SecretBaseListMenuBuffer *gUnknown_0203A020 = NULL; // Static ROM declarations @@ -407,7 +407,7 @@ void sub_80E9068(void) bool8 sub_80E909C(void) { - if (gMapHeader.mapType == MAP_TYPE_SECRET_BASE && VarGet(VAR_SECRET_BASE_SHOULD_BE_INIT) == 0) + if (gMapHeader.mapType == MAP_TYPE_SECRET_BASE && VarGet(VAR_INIT_SECRET_BASE) == 0) { return FALSE; } @@ -1186,11 +1186,11 @@ void SecretBasePerStepCallback(u8 taskId) case 0: if (VarGet(VAR_CURRENT_SECRET_BASE) != 0) { - gIsInSecretBase = TRUE; + gInFriendSecretBase = TRUE; } else { - gIsInSecretBase = FALSE; + gInFriendSecretBase = FALSE; } PlayerGetDestCoords(&data[2], &data[3]); data[1] = 1; @@ -1206,35 +1206,35 @@ void SecretBasePerStepCallback(u8 taskId) tileId = MapGridGetMetatileIdAt(x, y); if (tileId == 0x234 || tileId == 0x23C) { - if (gIsInSecretBase == TRUE) + if (gInFriendSecretBase == TRUE) { VarSet(VAR_SECRET_BASE_HIGH_TV_FLAGS, VarGet(VAR_SECRET_BASE_HIGH_TV_FLAGS) | 0x20); } } else if (tileId == 0x2b8 || tileId == 0x2b9 || tileId == 0x2ba || tileId == 0x2c0 || tileId == 0x2c1 || tileId == 0x2c2 || tileId == 0x2c8 || tileId == 0x2c9 || tileId == 0x2ca) { - if (gIsInSecretBase == TRUE) + if (gInFriendSecretBase == TRUE) { VarSet(VAR_SECRET_BASE_LOW_TV_FLAGS, VarGet(VAR_SECRET_BASE_LOW_TV_FLAGS) | 0x01); } } else if (tileId == 0x239 || tileId == 0x241 || tileId == 0x251 || tileId == 0x259) { - if (gIsInSecretBase == TRUE) + if (gInFriendSecretBase == TRUE) { VarSet(VAR_SECRET_BASE_LOW_TV_FLAGS, VarGet(VAR_SECRET_BASE_LOW_TV_FLAGS) | 0x04); } } else if ((behavior == 0x34 && tileId == 0x26d) || (behavior == 0x35 && MapGridGetMetatileIdAt(x, y) == 0x26a)) { - if (gIsInSecretBase == TRUE) + if (gInFriendSecretBase == TRUE) { VarSet(VAR_SECRET_BASE_HIGH_TV_FLAGS, VarGet(VAR_SECRET_BASE_HIGH_TV_FLAGS) | 0x200); } } else if (behavior == 0xc1 && tileId == 0x23d) { - if (gIsInSecretBase == TRUE) + if (gInFriendSecretBase == TRUE) { VarSet(VAR_SECRET_BASE_HIGH_TV_FLAGS, VarGet(VAR_SECRET_BASE_HIGH_TV_FLAGS) ^ 0x1000); VarSet(VAR_SECRET_BASE_HIGH_TV_FLAGS, VarGet(VAR_SECRET_BASE_HIGH_TV_FLAGS) | 0x2000); @@ -1242,7 +1242,7 @@ void SecretBasePerStepCallback(u8 taskId) } else if (behavior == 0x47 && tileId == 0x23e) { - if (gIsInSecretBase == TRUE) + if (gInFriendSecretBase == TRUE) { VarSet(VAR_SECRET_BASE_HIGH_TV_FLAGS, VarGet(VAR_SECRET_BASE_HIGH_TV_FLAGS) | 0x1000); VarSet(VAR_SECRET_BASE_HIGH_TV_FLAGS, VarGet(VAR_SECRET_BASE_HIGH_TV_FLAGS) ^ 0x2000); @@ -1250,7 +1250,7 @@ void SecretBasePerStepCallback(u8 taskId) } else if (MetatileBehavior_IsSecretBaseGlitterMat(behavior) == TRUE) { - if (gIsInSecretBase == TRUE) + if (gInFriendSecretBase == TRUE) { VarSet(VAR_SECRET_BASE_HIGH_TV_FLAGS, VarGet(VAR_SECRET_BASE_HIGH_TV_FLAGS) | 0x80); } @@ -1258,7 +1258,7 @@ void SecretBasePerStepCallback(u8 taskId) else if (MetatileBehavior_IsSecretBaseBalloon(behavior) == TRUE) { PopSecretBaseBalloon(MapGridGetMetatileIdAt(x, y), x, y); - if (gIsInSecretBase == TRUE) + if (gInFriendSecretBase == TRUE) { switch ((int)MapGridGetMetatileIdAt(x, y)) { @@ -1275,27 +1275,27 @@ void SecretBasePerStepCallback(u8 taskId) } else if (MetatileBehavior_IsSecretBaseBreakableDoor(behavior) == TRUE) { - if (gIsInSecretBase == TRUE) + if (gInFriendSecretBase == TRUE) { VarSet(VAR_SECRET_BASE_HIGH_TV_FLAGS, VarGet(VAR_SECRET_BASE_HIGH_TV_FLAGS) | 0x400); } ShatterSecretBaseBreakableDoor(x, y); } else if (MetatileBehavior_IsSecretBaseSoundMat(behavior) == TRUE){ - if (gIsInSecretBase == TRUE) { + if (gInFriendSecretBase == TRUE) { VarSet(VAR_SECRET_BASE_LOW_TV_FLAGS, VarGet(VAR_SECRET_BASE_LOW_TV_FLAGS) | 0x8000); } } else if (MetatileBehavior_IsSecretBaseJumpMat(behavior) == TRUE) { - if (gIsInSecretBase == TRUE) + if (gInFriendSecretBase == TRUE) { VarSet(VAR_SECRET_BASE_HIGH_TV_FLAGS, VarGet(VAR_SECRET_BASE_HIGH_TV_FLAGS) | 0x4000); } } else if (MetatileBehavior_IsSecretBaseSpinMat(behavior) == TRUE) { - if (gIsInSecretBase == TRUE) + if (gInFriendSecretBase == TRUE) { VarSet(VAR_SECRET_BASE_HIGH_TV_FLAGS, VarGet(VAR_SECRET_BASE_HIGH_TV_FLAGS) | 0x02); } @@ -1792,15 +1792,15 @@ void sub_80EB1AC(void) { VarSet(VAR_SECRET_BASE_IS_NOT_LOCAL, FALSE); } - gIsInSecretBase = FALSE; + gInFriendSecretBase = FALSE; } void sub_80EB218(void) { - if (VarGet(VAR_SECRET_BASE_IS_NOT_LOCAL) && gIsInSecretBase == TRUE && !CurrentMapIsSecretBase()) + if (VarGet(VAR_SECRET_BASE_IS_NOT_LOCAL) && gInFriendSecretBase == TRUE && !CurrentMapIsSecretBase()) { VarSet(VAR_SECRET_BASE_IS_NOT_LOCAL, FALSE); - gIsInSecretBase = FALSE; + gInFriendSecretBase = FALSE; sub_80EEA70(); VarSet(VAR_SECRET_BASE_STEP_COUNTER, 0); VarSet(VAR_SECRET_BASE_LAST_ITEM_USED, 0); diff --git a/src/time_events.c b/src/time_events.c index 9263bffac..bd51f0c2d 100644 --- a/src/time_events.c +++ b/src/time_events.c @@ -81,7 +81,7 @@ void UpdateShoalTideFlag(void) 1, // 23 }; - if (IsMapTypeOutside(GetLastUsedWarpMapType())) + if (IsMapTypeOutdoors(GetLastUsedWarpMapType())) { RtcCalcLocalTime(); if (tide[gLocalTime.hours]) diff --git a/src/trainer_hill.c b/src/trainer_hill.c index ee7e2287a..06ca8615f 100644 --- a/src/trainer_hill.c +++ b/src/trainer_hill.c @@ -93,7 +93,7 @@ struct TrHillStruct2 // EWRAM static EWRAM_DATA struct TrHillStruct2 *sHillData = NULL; static EWRAM_DATA struct TrHillRoomTrainers *sRoomTrainers = NULL; -EWRAM_DATA u32 *gVBlankCounterPointer = NULL; +EWRAM_DATA u32 *gTrainerHillVBlankCounter = NULL; // This file's functions. static void TrainerHillStartChallenge(void); @@ -372,7 +372,7 @@ void InitTrainerHillBattleStruct(void) } sRoomTrainers->facilityClass[i] = sHillData->tag.floors[sHillData->floorId].trainers[i].facilityClass; } - SetVBlankCounterPointer(&gSaveBlock1Ptr->trainerHill.timer); + SetTrainerHillVBlankCounter(&gSaveBlock1Ptr->trainerHill.timer); FreeDataStruct(); } @@ -435,7 +435,7 @@ static void TrainerHillStartChallenge(void) gSaveBlock1Ptr->trainerHill.field_3D6E_0f = 0; gSaveBlock1Ptr->trainerHill.field_3D6C = 0; - SetVBlankCounterPointer(&gSaveBlock1Ptr->trainerHill.timer); + SetTrainerHillVBlankCounter(&gSaveBlock1Ptr->trainerHill.timer); gSaveBlock1Ptr->trainerHill.timer = 0; gSaveBlock1Ptr->trainerHill.field_3D6E_0c = 0; gSaveBlock1Ptr->trainerHill.field_3D6E_0b = 0; @@ -447,7 +447,7 @@ static void TrainerHillStartChallenge(void) static void sub_81D58D8(void) { - ClearVBlankCounterPointer(); + ClearTrainerHillVBlankCounter(); gSpecialVar_Result = 0; if (gSaveBlock1Ptr->trainerHill.field_3D6E_0c) gSpecialVar_Result++; @@ -505,7 +505,7 @@ static void TrainerHillResumeTimer(void) if (gSaveBlock1Ptr->trainerHill.timer >= HILL_MAX_TIME) gSaveBlock1Ptr->trainerHill.timer = HILL_MAX_TIME; else - SetVBlankCounterPointer(&gSaveBlock1Ptr->trainerHill.timer); + SetTrainerHillVBlankCounter(&gSaveBlock1Ptr->trainerHill.timer); } }