Handle optional arguments for warp commands, add WARP_ID_NONE

This commit is contained in:
GriffinR
2021-11-15 12:04:54 -05:00
parent c1130592fa
commit 04cc923d6c
145 changed files with 342 additions and 352 deletions
+4 -5
View File
@@ -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)