From f26e64f3ba2082593ece5e8aea29e19ba90a4bf0 Mon Sep 17 00:00:00 2001 From: Thomas Winwood Date: Sat, 23 Jan 2021 22:18:15 +0000 Subject: [PATCH] Updated Fix Snow Weather (markdown) --- Fix-Snow-Weather.md | 41 ++++++++++++++--------------------------- 1 file changed, 14 insertions(+), 27 deletions(-) diff --git a/Fix-Snow-Weather.md b/Fix-Snow-Weather.md index 7a3ff30..3c5246a 100644 --- a/Fix-Snow-Weather.md +++ b/Fix-Snow-Weather.md @@ -10,33 +10,20 @@ For starters, open [src/field_weather_effect.c](../blob/master/src/field_weather If you want to have the snow be heavier (or lighter), find `Snow_InitVars` and edit the line `gWeatherPtr->targetSnowflakeSpriteCount = 16;` to a value of your choosing. ### Stop the snow from disappearing -Find the function `UpdateSnowflakeSprite`, and delete the following code (lines 974-998): -```c - y = (sprite->pos1.y + sprite->centerToCornerVecY + gSpriteCoordOffsetY) & 0xFF; - if (y > 163 && y < 171) - { - sprite->pos1.y = 250 - (gSpriteCoordOffsetY + sprite->centerToCornerVecY); - sprite->tPosY = sprite->pos1.y * 128; - sprite->tFallCounter = 0; - sprite->tFallDuration = 220; - } - else if (y > 242 && y < 250) - { - sprite->pos1.y = 163; - sprite->tPosY = sprite->pos1.y * 128; - sprite->tFallCounter = 0; - sprite->tFallDuration = 220; - sprite->invisible = TRUE; - sprite->callback = WaitSnowflakeSprite; - } - - if (++sprite->tFallCounter == sprite->tFallDuration) - { - InitSnowflakeSpriteMovement(sprite); - sprite->pos1.y = 250; - sprite->invisible = TRUE; - sprite->callback = WaitSnowflakeSprite; - } +Find the function `WaitSnowflakeSprite` and alter it as follows: +```diff + static void WaitSnowflakeSprite(struct Sprite *sprite) + { +- if (gWeatherPtr->unknown_6E2 > 18) ++ if (++gWeatherPtr->unknown_6E2 > 18) + { + sprite->invisible = FALSE; + sprite->callback = UpdateSnowflakeSprite; + sprite->pos1.y = 250 - (gSpriteCoordOffsetY + sprite->centerToCornerVecY); + sprite->tPosY = sprite->pos1.y * 128; + gWeatherPtr->unknown_6E2 = 0; + } + } ``` ### Fix snow spawning upon returning to the overworld