Updated Fix Snow Weather (markdown)

Thomas Winwood 2021-01-23 22:18:15 +00:00
parent c94b91e1d6
commit f26e64f3ba
1 changed files with 14 additions and 27 deletions

@ -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