From 9eee076e643519bbe112da1b8e99c769f5225a68 Mon Sep 17 00:00:00 2001 From: AlexOn1ine Date: Sat, 4 Jan 2025 12:16:35 +0100 Subject: [PATCH] use one iterator --- src/battle_util.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/battle_util.c b/src/battle_util.c index 33152376f2..1f2e301f47 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -1669,14 +1669,15 @@ static bool32 EndTurnTerrain(u32 terrainFlag, u32 stringTableId) static bool32 TryEndTurnWeather(void) { + u32 i = 0; u32 effect = 0; u32 currBattleWeather = 0xFF; - for (u32 weather = 0; weather < ARRAY_COUNT(sBattleWeatherInfo); weather++) + for (i = 0; i < ARRAY_COUNT(sBattleWeatherInfo); i++) { - if (gBattleWeather & sBattleWeatherInfo[weather].flag) + if (gBattleWeather & sBattleWeatherInfo[i].flag) { - currBattleWeather = weather; + currBattleWeather = i; break; } } @@ -1687,7 +1688,7 @@ static bool32 TryEndTurnWeather(void) if (gWishFutureKnock.weatherDuration > 0 && --gWishFutureKnock.weatherDuration == 0) { gBattleWeather = B_WEATHER_NONE; - for (u32 i = 0; i < gBattlersCount; i++) + for (i = 0; i < gBattlersCount; i++) gDisableStructs[i].weatherAbilityDone = FALSE; gBattleCommunication[MULTISTRING_CHOOSER] = sBattleWeatherInfo[currBattleWeather].endMessage; BattleScriptExecute(BattleScript_WeatherFaded);