mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-13 15:13:42 +01:00
use free_and_set_null macros
This commit is contained in:
parent
99630e954c
commit
2f9d69f67f
@ -75,7 +75,7 @@ static const u8 gCaveTransitionTiles[] = INCBIN_U8("graphics/misc/cave_transitio
|
|||||||
// text
|
// text
|
||||||
bool8 SetUpFieldMove_Flash(void)
|
bool8 SetUpFieldMove_Flash(void)
|
||||||
{
|
{
|
||||||
if(ShouldDoBrailleFlyEffect())
|
if (ShouldDoBrailleFlyEffect())
|
||||||
{
|
{
|
||||||
gSpecialVar_Result = GetCursorSelectionMonId();
|
gSpecialVar_Result = GetCursorSelectionMonId();
|
||||||
gUnknown_03005DB0 = FieldCallback_Teleport;
|
gUnknown_03005DB0 = FieldCallback_Teleport;
|
||||||
|
@ -292,8 +292,7 @@ static void sub_81BED50(u8 taskId)
|
|||||||
}
|
}
|
||||||
if(gUnknown_0203CF10[left].curr_buffer_index > (INNER_BUFFER_LENGTH - 1))
|
if(gUnknown_0203CF10[left].curr_buffer_index > (INNER_BUFFER_LENGTH - 1))
|
||||||
{
|
{
|
||||||
Free(gUnknown_0203CF10[left].buffer);
|
FREE_AND_SET_NULL(gUnknown_0203CF10[left].buffer);
|
||||||
gUnknown_0203CF10[left].buffer = NULL;
|
|
||||||
gTasks[taskId].data[2]++;
|
gTasks[taskId].data[2]++;
|
||||||
if((left % 2) == 1)
|
if((left % 2) == 1)
|
||||||
gUnknown_0203CF14[1]--;
|
gUnknown_0203CF14[1]--;
|
||||||
@ -313,14 +312,10 @@ static void sub_81BED50(u8 taskId)
|
|||||||
sub_81BEB90();
|
sub_81BEB90();
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
Free(gUnknown_0203CF14);
|
FREE_AND_SET_NULL(gUnknown_0203CF14);
|
||||||
gUnknown_0203CF14 = NULL;
|
FREE_AND_SET_NULL(gUnknown_0203CF10);
|
||||||
Free(gUnknown_0203CF10);
|
FREE_AND_SET_NULL(gUnknown_0203CF04);
|
||||||
gUnknown_0203CF10 = NULL;
|
FREE_AND_SET_NULL(gUnknown_0203CF08);
|
||||||
Free(gUnknown_0203CF04);
|
|
||||||
gUnknown_0203CF04 = NULL;
|
|
||||||
Free(gUnknown_0203CF08);
|
|
||||||
gUnknown_0203CF08 = NULL;
|
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
SetGpuRegBits(REG_OFFSET_BG2CNT, 0x2);
|
SetGpuRegBits(REG_OFFSET_BG2CNT, 0x2);
|
||||||
@ -742,14 +737,10 @@ static void sub_81BF028(u8 taskId)
|
|||||||
if(gSprites[gUnknown_0203CF0C->spriteId].callback != SpriteCallbackDummy)
|
if(gSprites[gUnknown_0203CF0C->spriteId].callback != SpriteCallbackDummy)
|
||||||
return;
|
return;
|
||||||
DestroySprite(&gSprites[gUnknown_0203CF0C->spriteId]);
|
DestroySprite(&gSprites[gUnknown_0203CF0C->spriteId]);
|
||||||
Free(gUnknown_0203CF0C->unkC);
|
FREE_AND_SET_NULL(gUnknown_0203CF0C->unkC);;
|
||||||
gUnknown_0203CF0C->unkC = NULL;
|
FREE_AND_SET_NULL(gUnknown_0203CF0C->frameImage);
|
||||||
Free(gUnknown_0203CF0C->frameImage);
|
FREE_AND_SET_NULL(gUnknown_0203CF0C->frameImageTiles);
|
||||||
gUnknown_0203CF0C->frameImage = NULL;
|
FREE_AND_SET_NULL(gUnknown_0203CF0C);
|
||||||
Free(gUnknown_0203CF0C->frameImageTiles);
|
|
||||||
gUnknown_0203CF0C->frameImageTiles = NULL;
|
|
||||||
Free(gUnknown_0203CF0C);
|
|
||||||
gUnknown_0203CF0C = NULL;
|
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
EnableBothScriptContexts();
|
EnableBothScriptContexts();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user