Skip to content

Commit

Permalink
Snow Weather Fix (Credit: ghoulslash)
Browse files Browse the repository at this point in the history
  • Loading branch information
lioniac committed Mar 17, 2021
1 parent 045daa7 commit 96c6f5a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/battle_message.c
Expand Up @@ -1121,7 +1121,7 @@ const u16 gWeatherContinuesStringIds[] = {
STRINGID_ITISRAINING,
STRINGID_ITISRAINING,
STRINGID_ITISRAINING,
STRINGID_ITISRAINING,
STRINGID_STARTEDHAIL,
STRINGID_ITISRAINING,
STRINGID_ITISRAINING,
STRINGID_ITISRAINING,
Expand All @@ -1130,7 +1130,7 @@ const u16 gWeatherContinuesStringIds[] = {
STRINGID_ITISRAINING,
STRINGID_ITISRAINING,
STRINGID_SUNLIGHTSTRONG,
STRINGID_ITISRAINING,
STRINGID_STARTEDHAIL,
STRINGID_ITISRAINING,
STRINGID_ITISRAINING
};
Expand Down
9 changes: 9 additions & 0 deletions src/battle_util.c
Expand Up @@ -1656,6 +1656,15 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
++effect;
}
break;
case WEATHER_SNOW:
if (!(gBattleWeather & WEATHER_HAIL_ANY))
{
gBattleWeather = WEATHER_HAIL_ANY;
gBattleScripting.animArg1 = B_ANIM_HAIL_CONTINUES;
gBattleScripting.battler = battler;
effect++;
}
break;
}
if (effect)
{
Expand Down
2 changes: 2 additions & 0 deletions src/field_weather.c
@@ -1,6 +1,7 @@
#include "global.h"
#include "gflib.h"
#include "blend_palette.h"
#include "field_camera.h"
#include "field_effect.h"
#include "field_weather.h"
#include "field_weather_util.h"
Expand Down Expand Up @@ -211,6 +212,7 @@ static void Task_WeatherInit(u8 taskId)
// When the screen fades in, this is set to TRUE.
if (gWeatherPtr->readyForInit)
{
UpdateCameraPanning();
sWeatherFuncs[gWeatherPtr->currWeather].initAll();
gTasks[taskId].func = Task_WeatherMain;
}
Expand Down
4 changes: 2 additions & 2 deletions src/field_weather_effects.c
Expand Up @@ -737,7 +737,7 @@ void Snow_InitVars(void)
gWeatherPtr->weatherGfxLoaded = FALSE;
gWeatherPtr->gammaTargetIndex = 3;
gWeatherPtr->gammaStepDelay = 20;
gWeatherPtr->targetSnowflakeSpriteCount = 16;
gWeatherPtr->targetSnowflakeSpriteCount = 20;
gWeatherPtr->snowflakeVisibleCounter = 0;
}

Expand Down Expand Up @@ -901,7 +901,7 @@ static void InitSnowflakeSpriteMovement(struct Sprite *sprite)

static void WaitSnowflakeSprite(struct Sprite *sprite)
{
if (gWeatherPtr->unknown_6E2 > 18)
if (++gWeatherPtr->unknown_6E2 > 18)
{
sprite->invisible = FALSE;
sprite->callback = UpdateSnowflakeSprite;
Expand Down

0 comments on commit 96c6f5a

Please sign in to comment.