diff options
author | GriffinR <griffin.g.richards@gmail.com> | 2021-11-15 12:04:54 -0500 |
---|---|---|
committer | GriffinR <griffin.g.richards@gmail.com> | 2021-11-16 10:53:00 -0500 |
commit | 04cc923d6c17edae778f14cb431991867a05cf65 (patch) | |
tree | b6e1b5bede12da3f64293dde84b1b09f08d40053 /src/field_control_avatar.c | |
parent | c1130592faa26f4e555142c48bdc02c1378ff1ee (diff) |
Handle optional arguments for warp commands, add WARP_ID_NONE
Diffstat (limited to 'src/field_control_avatar.c')
-rw-r--r-- | src/field_control_avatar.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 6d338c06d..8d6b564d2 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -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) |