Handle optional arguments for warp commands, add WARP_ID_NONE
This commit is contained in:
@@ -32,7 +32,6 @@
|
||||
#include "constants/event_objects.h"
|
||||
#include "constants/field_poison.h"
|
||||
#include "constants/map_types.h"
|
||||
#include "constants/maps.h"
|
||||
#include "constants/songs.h"
|
||||
#include "constants/trainer_hill.h"
|
||||
|
||||
@@ -691,7 +690,7 @@ static bool8 TryArrowWarp(struct MapPosition *position, u16 metatileBehavior, u8
|
||||
{
|
||||
s8 warpEventId = GetWarpEventAtMapPosition(&gMapHeader, position);
|
||||
|
||||
if (IsArrowWarpMetatileBehavior(metatileBehavior, direction) == TRUE && warpEventId != -1)
|
||||
if (IsArrowWarpMetatileBehavior(metatileBehavior, direction) == TRUE && warpEventId != WARP_ID_NONE)
|
||||
{
|
||||
StoreInitialPlayerAvatarState();
|
||||
SetupWarp(&gMapHeader, warpEventId, position);
|
||||
@@ -705,7 +704,7 @@ static bool8 TryStartWarpEventScript(struct MapPosition *position, u16 metatileB
|
||||
{
|
||||
s8 warpEventId = GetWarpEventAtMapPosition(&gMapHeader, position);
|
||||
|
||||
if (warpEventId != -1 && IsWarpMetatileBehavior(metatileBehavior) == TRUE)
|
||||
if (warpEventId != WARP_ID_NONE && IsWarpMetatileBehavior(metatileBehavior) == TRUE)
|
||||
{
|
||||
StoreInitialPlayerAvatarState();
|
||||
SetupWarp(&gMapHeader, warpEventId, position);
|
||||
@@ -847,7 +846,7 @@ static bool8 TryDoorWarp(struct MapPosition *position, u16 metatileBehavior, u8
|
||||
if (MetatileBehavior_IsWarpDoor(metatileBehavior) == TRUE)
|
||||
{
|
||||
warpEventId = GetWarpEventAtMapPosition(&gMapHeader, position);
|
||||
if (warpEventId != -1 && IsWarpMetatileBehavior(metatileBehavior) == TRUE)
|
||||
if (warpEventId != WARP_ID_NONE && IsWarpMetatileBehavior(metatileBehavior) == TRUE)
|
||||
{
|
||||
StoreInitialPlayerAvatarState();
|
||||
SetupWarp(&gMapHeader, warpEventId, position);
|
||||
@@ -873,7 +872,7 @@ static s8 GetWarpEventAtPosition(struct MapHeader *mapHeader, u16 x, u16 y, u8 e
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
return WARP_ID_NONE;
|
||||
}
|
||||
|
||||
static u8 *TryRunCoordEventScript(struct CoordEvent *coordEvent)
|
||||
|
||||
Reference in New Issue
Block a user