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 /include | |
parent | c1130592faa26f4e555142c48bdc02c1378ff1ee (diff) |
Handle optional arguments for warp commands, add WARP_ID_NONE
Diffstat (limited to 'include')
-rw-r--r-- | include/constants/maps.h | 12 | ||||
-rw-r--r-- | include/global.h | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/include/constants/maps.h b/include/constants/maps.h index b849749a9..6524f8c14 100644 --- a/include/constants/maps.h +++ b/include/constants/maps.h @@ -15,4 +15,16 @@ #define MAP_GROUP_SPECIAL_MONS_1 MAP_GROUP(METEOR_FALLS_1F_1R) #define MAP_GROUP_SPECIAL_MONS_2 MAP_GROUP(SAFARI_ZONE_NORTHWEST) +// IDs for dynamic warps. Both are used in the dest_warp_id field for warp events, but they +// are never read in practice. A dest_map of MAP_NONE is used to indicate that a +// dynamic warp should be used, at which point the warp id is ignored. It can be passed to +// SetDynamicWarp/SetDynamicWarpWithCoords as the first argument, but this argument is unused. +// As only one dynamic warp is saved at a time there's no need to distinguish between them. +#define WARP_ID_SECRET_BASE 0x7E +#define WARP_ID_DYNAMIC 0x7F + +// Used to indicate an invalid warp id, for dummy warps or when a warp should +// use the given coordinates rather than the coordinates of a target warp. +#define WARP_ID_NONE (-1) + #endif // GUARD_CONSTANTS_MAPS_H diff --git a/include/global.h b/include/global.h index 53e9ba134..9aac66fda 100644 --- a/include/global.h +++ b/include/global.h @@ -10,6 +10,7 @@ #include "constants/vars.h" #include "constants/species.h" #include "constants/berry.h" +#include "constants/maps.h" // Prevent cross-jump optimization. #define BLOCK_CROSS_JUMP asm(""); |