From 4a557cfebd5e543741ab54e69713d83a9b5269e7 Mon Sep 17 00:00:00 2001 From: Rangi Date: Sun, 7 Jun 2026 21:32:02 -0400 Subject: [PATCH] Remove the spurious `WEATHER_*_END` constants These were probably a mistake from confusing two consecutive pointer tables, `.WeatherMessages` and `.WeatherEndedMessages`, with one long table --- constants/battle_constants.asm | 4 +--- engine/battle/core.asm | 6 +++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/constants/battle_constants.asm b/constants/battle_constants.asm index 72888540..14a627c0 100644 --- a/constants/battle_constants.asm +++ b/constants/battle_constants.asm @@ -229,9 +229,7 @@ DEF ALL_STATUS EQU (1 << PSN) | (1 << BRN) | (1 << FRZ) | (1 << PAR) | SLP_MASK const WEATHER_RAIN const WEATHER_SUN const WEATHER_SANDSTORM - const WEATHER_RAIN_END - const WEATHER_SUN_END - const WEATHER_SANDSTORM_END +DEF NUM_WEATHERS EQU const_value - 1 ; wBattleAction const_def diff --git a/engine/battle/core.asm b/engine/battle/core.asm index f95a08bc..4fb6983c 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -1700,7 +1700,7 @@ HandleWeather: .ended ld hl, .WeatherEndedMessages call .PrintWeatherMessage - xor a + xor a ; WEATHER_NONE ld [wBattleWeather], a ret @@ -1718,15 +1718,19 @@ HandleWeather: .WeatherMessages: ; entries correspond to WEATHER_* constants + table_width 2 dw BattleText_RainContinuesToFall dw BattleText_TheSunlightIsStrong dw BattleText_TheSandstormRages + assert_table_length NUM_WEATHERS .WeatherEndedMessages: ; entries correspond to WEATHER_* constants + table_width 2 dw BattleText_TheRainStopped dw BattleText_TheSunlightFaded dw BattleText_TheSandstormSubsided + assert_table_length NUM_WEATHERS SubtractHPFromTarget: call SubtractHP