mirror of
https://github.com/pret/pokeemerald.git
synced 2026-09-11 12:37:14 -05:00
Add some null pointer checks (#5130)
* Fix some null pointer uses * fix bad merge
This commit is contained in:
@@ -1998,7 +1998,10 @@ static void VBlankCB_PokeStorage(void)
|
||||
ProcessSpriteCopyRequests();
|
||||
UnkUtil_Run();
|
||||
TransferPlttBuffer();
|
||||
SetGpuReg(REG_OFFSET_BG2HOFS, sStorage->bg2_X);
|
||||
if (sStorage != NULL)
|
||||
{
|
||||
SetGpuReg(REG_OFFSET_BG2HOFS, sStorage->bg2_X);
|
||||
}
|
||||
}
|
||||
|
||||
static void CB2_PokeStorage(void)
|
||||
@@ -4206,11 +4209,14 @@ static void StopFlashingCloseBoxButton(void)
|
||||
|
||||
static void UpdateCloseBoxButtonFlash(void)
|
||||
{
|
||||
if (sStorage->closeBoxFlashing && ++sStorage->closeBoxFlashTimer > 30)
|
||||
if (sStorage != NULL)
|
||||
{
|
||||
sStorage->closeBoxFlashTimer = 0;
|
||||
sStorage->closeBoxFlashState = (sStorage->closeBoxFlashState == FALSE);
|
||||
UpdateCloseBoxButtonTilemap(sStorage->closeBoxFlashState);
|
||||
if (sStorage->closeBoxFlashing && ++sStorage->closeBoxFlashTimer > 30)
|
||||
{
|
||||
sStorage->closeBoxFlashTimer = 0;
|
||||
sStorage->closeBoxFlashState = (sStorage->closeBoxFlashState == FALSE);
|
||||
UpdateCloseBoxButtonTilemap(sStorage->closeBoxFlashState);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user