mirror of
https://github.com/pret/pokeemerald.git
synced 2026-03-21 17:54:57 -05:00
Added bugfix for missing no weather case in Cmd_weather_get (#2203)
Some checks failed
CI / build (push) Has been cancelled
Some checks failed
CI / build (push) Has been cancelled
This commit is contained in:
parent
f0e351b33d
commit
02c44242f8
|
|
@ -23,6 +23,7 @@
|
|||
#define AI_EFFECTIVENESS_x0 0
|
||||
|
||||
// ai weather
|
||||
#define AI_WEATHER_NONE UINT32_MAX // added as part of bugfix, see Cmd_weather_get in battle_ai_script_commands.c
|
||||
#define AI_WEATHER_SUN 0
|
||||
#define AI_WEATHER_RAIN 1
|
||||
#define AI_WEATHER_SANDSTORM 2
|
||||
|
|
|
|||
|
|
@ -1643,6 +1643,15 @@ static void Cmd_if_status_not_in_party(void)
|
|||
|
||||
static void Cmd_get_weather(void)
|
||||
{
|
||||
// BUG: due to the lack of an assignment in the case of there not being any
|
||||
// weather set any previously set value could possibly be interpreted
|
||||
// as a result of this function.
|
||||
// Assigning AI_WEATHER_NONE here matches the fix implemented in future
|
||||
// generations.
|
||||
#ifdef BUGFIX
|
||||
AI_THINKING_STRUCT->funcResult = AI_WEATHER_NONE;
|
||||
#endif
|
||||
|
||||
if (gBattleWeather & B_WEATHER_RAIN)
|
||||
AI_THINKING_STRUCT->funcResult = AI_WEATHER_RAIN;
|
||||
if (gBattleWeather & B_WEATHER_SANDSTORM)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user