mirror of
https://github.com/pret/pokeemerald.git
synced 2026-09-27 12:26:51 -05:00
merge w pret
This commit is contained in:
15
src/script.c
15
src/script.c
@@ -1,8 +1,9 @@
|
||||
#include "global.h"
|
||||
#include "script.h"
|
||||
#include "event_data.h"
|
||||
#include "mevent.h"
|
||||
#include "mystery_gift.h"
|
||||
#include "util.h"
|
||||
#include "constants/maps.h"
|
||||
#include "constants/map_scripts.h"
|
||||
|
||||
#define RAM_SCRIPT_MAGIC 51
|
||||
@@ -418,9 +419,9 @@ bool32 ValidateSavedRamScript(void)
|
||||
struct RamScriptData *scriptData = &gSaveBlock1Ptr->ramScript.data;
|
||||
if (scriptData->magic != RAM_SCRIPT_MAGIC)
|
||||
return FALSE;
|
||||
if (scriptData->mapGroup != 0xFF)
|
||||
if (scriptData->mapGroup != MAP_GROUP(UNDEFINED))
|
||||
return FALSE;
|
||||
if (scriptData->mapNum != 0xFF)
|
||||
if (scriptData->mapNum != MAP_NUM(UNDEFINED))
|
||||
return FALSE;
|
||||
if (scriptData->objectId != 0xFF)
|
||||
return FALSE;
|
||||
@@ -436,13 +437,13 @@ u8 *GetSavedRamScriptIfValid(void)
|
||||
{
|
||||
#ifndef FREE_MYSTERY_EVENT_BUFFERS
|
||||
struct RamScriptData *scriptData = &gSaveBlock1Ptr->ramScript.data;
|
||||
if (!ValidateReceivedWonderCard())
|
||||
if (!ValidateSavedWonderCard())
|
||||
return NULL;
|
||||
if (scriptData->magic != RAM_SCRIPT_MAGIC)
|
||||
return NULL;
|
||||
if (scriptData->mapGroup != 0xFF)
|
||||
if (scriptData->mapGroup != MAP_GROUP(UNDEFINED))
|
||||
return NULL;
|
||||
if (scriptData->mapNum != 0xFF)
|
||||
if (scriptData->mapNum != MAP_NUM(UNDEFINED))
|
||||
return NULL;
|
||||
if (scriptData->objectId != 0xFF)
|
||||
return NULL;
|
||||
@@ -465,6 +466,6 @@ void InitRamScript_NoObjectEvent(u8 *script, u16 scriptSize)
|
||||
#ifndef FREE_MYSTERY_EVENT_BUFFERS
|
||||
if (scriptSize > sizeof(gSaveBlock1Ptr->ramScript.data.script))
|
||||
scriptSize = sizeof(gSaveBlock1Ptr->ramScript.data.script);
|
||||
InitRamScript(script, scriptSize, 0xFF, 0xFF, 0xFF);
|
||||
InitRamScript(script, scriptSize, MAP_GROUP(UNDEFINED), MAP_NUM(UNDEFINED), 0xFF);
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user