diff --git a/asm/macros/event.inc b/asm/macros/event.inc index cea21aeb2..09ae12ab1 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -469,7 +469,7 @@ formatwarp \map, \a, \b, \c .endm - @ Sets the dynamic warp destination. Warps with a destination map of MAP_NONE will target this destination. + @ Sets the dynamic warp destination. Warps with a destination map of MAP_DYNAMIC will target this destination. @ Warp commands can be given either the id of which warp location to go to on the destination map @ or a pair of x/y coordinates to go to directly on the destination map. .macro setdynamicwarp map:req, a, b, c diff --git a/data/maps/BattleColosseum_2P/map.json b/data/maps/BattleColosseum_2P/map.json index 3c9887a65..5c78145d2 100644 --- a/data/maps/BattleColosseum_2P/map.json +++ b/data/maps/BattleColosseum_2P/map.json @@ -33,14 +33,14 @@ "x": 6, "y": 8, "elevation": 3, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 127 }, { "x": 7, "y": 8, "elevation": 3, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 127 } ], diff --git a/data/maps/BattleColosseum_4P/map.json b/data/maps/BattleColosseum_4P/map.json index a6eddc9a8..66613decb 100644 --- a/data/maps/BattleColosseum_4P/map.json +++ b/data/maps/BattleColosseum_4P/map.json @@ -19,28 +19,28 @@ "x": 5, "y": 8, "elevation": 3, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 127 }, { "x": 6, "y": 8, "elevation": 3, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 127 }, { "x": 7, "y": 8, "elevation": 3, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 127 }, { "x": 8, "y": 8, "elevation": 3, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 127 } ], diff --git a/data/maps/InsideOfTruck/map.json b/data/maps/InsideOfTruck/map.json index 0ddc579fc..63e4f0cb0 100644 --- a/data/maps/InsideOfTruck/map.json +++ b/data/maps/InsideOfTruck/map.json @@ -59,21 +59,21 @@ "x": 4, "y": 1, "elevation": 0, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 127 }, { "x": 4, "y": 2, "elevation": 0, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 127 }, { "x": 4, "y": 3, "elevation": 0, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 127 } ], diff --git a/data/maps/LilycoveCity_DepartmentStoreElevator/map.json b/data/maps/LilycoveCity_DepartmentStoreElevator/map.json index 9a3c43308..dd6cb14f7 100644 --- a/data/maps/LilycoveCity_DepartmentStoreElevator/map.json +++ b/data/maps/LilycoveCity_DepartmentStoreElevator/map.json @@ -33,14 +33,14 @@ "x": 1, "y": 5, "elevation": 3, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 127 }, { "x": 2, "y": 5, "elevation": 3, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 127 } ], diff --git a/data/maps/RecordCorner/map.json b/data/maps/RecordCorner/map.json index 083f44445..6bbf55a71 100644 --- a/data/maps/RecordCorner/map.json +++ b/data/maps/RecordCorner/map.json @@ -33,28 +33,28 @@ "x": 8, "y": 9, "elevation": 3, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 127 }, { "x": 9, "y": 9, "elevation": 3, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 127 }, { "x": 11, "y": 9, "elevation": 3, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 127 }, { "x": 10, "y": 9, "elevation": 3, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 127 } ], diff --git a/data/maps/SecretBase_BlueCave1/map.json b/data/maps/SecretBase_BlueCave1/map.json index 066cfb385..21be99c9e 100644 --- a/data/maps/SecretBase_BlueCave1/map.json +++ b/data/maps/SecretBase_BlueCave1/map.json @@ -216,7 +216,7 @@ "x": 5, "y": 7, "elevation": 0, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 126 } ], diff --git a/data/maps/SecretBase_BlueCave2/map.json b/data/maps/SecretBase_BlueCave2/map.json index b74fa5afb..5b75d4d1e 100644 --- a/data/maps/SecretBase_BlueCave2/map.json +++ b/data/maps/SecretBase_BlueCave2/map.json @@ -216,7 +216,7 @@ "x": 7, "y": 5, "elevation": 0, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 126 } ], diff --git a/data/maps/SecretBase_BlueCave3/map.json b/data/maps/SecretBase_BlueCave3/map.json index dd67e2d54..91828e941 100644 --- a/data/maps/SecretBase_BlueCave3/map.json +++ b/data/maps/SecretBase_BlueCave3/map.json @@ -216,7 +216,7 @@ "x": 4, "y": 15, "elevation": 0, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 126 } ], diff --git a/data/maps/SecretBase_BlueCave4/map.json b/data/maps/SecretBase_BlueCave4/map.json index 3c97371f5..190476180 100644 --- a/data/maps/SecretBase_BlueCave4/map.json +++ b/data/maps/SecretBase_BlueCave4/map.json @@ -216,7 +216,7 @@ "x": 4, "y": 15, "elevation": 0, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 126 } ], diff --git a/data/maps/SecretBase_BrownCave1/map.json b/data/maps/SecretBase_BrownCave1/map.json index 062eac9f4..9a2b6db16 100644 --- a/data/maps/SecretBase_BrownCave1/map.json +++ b/data/maps/SecretBase_BrownCave1/map.json @@ -216,7 +216,7 @@ "x": 5, "y": 7, "elevation": 0, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 126 } ], diff --git a/data/maps/SecretBase_BrownCave2/map.json b/data/maps/SecretBase_BrownCave2/map.json index eb04f2a8d..6f949dd88 100644 --- a/data/maps/SecretBase_BrownCave2/map.json +++ b/data/maps/SecretBase_BrownCave2/map.json @@ -216,7 +216,7 @@ "x": 1, "y": 7, "elevation": 0, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 126 } ], diff --git a/data/maps/SecretBase_BrownCave3/map.json b/data/maps/SecretBase_BrownCave3/map.json index 1d00ee139..4f64c516d 100644 --- a/data/maps/SecretBase_BrownCave3/map.json +++ b/data/maps/SecretBase_BrownCave3/map.json @@ -216,7 +216,7 @@ "x": 11, "y": 9, "elevation": 0, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 126 } ], diff --git a/data/maps/SecretBase_BrownCave4/map.json b/data/maps/SecretBase_BrownCave4/map.json index f1fb82eb4..592387ecc 100644 --- a/data/maps/SecretBase_BrownCave4/map.json +++ b/data/maps/SecretBase_BrownCave4/map.json @@ -216,7 +216,7 @@ "x": 2, "y": 8, "elevation": 0, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 126 } ], diff --git a/data/maps/SecretBase_RedCave1/map.json b/data/maps/SecretBase_RedCave1/map.json index e83458a87..f06d70b2e 100644 --- a/data/maps/SecretBase_RedCave1/map.json +++ b/data/maps/SecretBase_RedCave1/map.json @@ -216,7 +216,7 @@ "x": 5, "y": 7, "elevation": 0, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 126 } ], diff --git a/data/maps/SecretBase_RedCave2/map.json b/data/maps/SecretBase_RedCave2/map.json index 9a0ac210f..6551387be 100644 --- a/data/maps/SecretBase_RedCave2/map.json +++ b/data/maps/SecretBase_RedCave2/map.json @@ -216,7 +216,7 @@ "x": 3, "y": 14, "elevation": 0, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 126 } ], diff --git a/data/maps/SecretBase_RedCave3/map.json b/data/maps/SecretBase_RedCave3/map.json index ce405a40a..85a74af00 100644 --- a/data/maps/SecretBase_RedCave3/map.json +++ b/data/maps/SecretBase_RedCave3/map.json @@ -216,7 +216,7 @@ "x": 3, "y": 6, "elevation": 0, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 126 } ], diff --git a/data/maps/SecretBase_RedCave4/map.json b/data/maps/SecretBase_RedCave4/map.json index 2b1ad8c2c..154046665 100644 --- a/data/maps/SecretBase_RedCave4/map.json +++ b/data/maps/SecretBase_RedCave4/map.json @@ -216,7 +216,7 @@ "x": 2, "y": 12, "elevation": 0, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 126 } ], diff --git a/data/maps/SecretBase_Shrub1/map.json b/data/maps/SecretBase_Shrub1/map.json index a028cbe62..1f6306b19 100644 --- a/data/maps/SecretBase_Shrub1/map.json +++ b/data/maps/SecretBase_Shrub1/map.json @@ -216,7 +216,7 @@ "x": 5, "y": 7, "elevation": 0, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 126 } ], diff --git a/data/maps/SecretBase_Shrub2/map.json b/data/maps/SecretBase_Shrub2/map.json index 60977e70d..fb1424d03 100644 --- a/data/maps/SecretBase_Shrub2/map.json +++ b/data/maps/SecretBase_Shrub2/map.json @@ -216,7 +216,7 @@ "x": 7, "y": 5, "elevation": 0, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 126 } ], diff --git a/data/maps/SecretBase_Shrub3/map.json b/data/maps/SecretBase_Shrub3/map.json index a513b0bd2..efdd0189f 100644 --- a/data/maps/SecretBase_Shrub3/map.json +++ b/data/maps/SecretBase_Shrub3/map.json @@ -216,7 +216,7 @@ "x": 6, "y": 9, "elevation": 0, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 126 } ], diff --git a/data/maps/SecretBase_Shrub4/map.json b/data/maps/SecretBase_Shrub4/map.json index 6aded553b..98834ec66 100644 --- a/data/maps/SecretBase_Shrub4/map.json +++ b/data/maps/SecretBase_Shrub4/map.json @@ -216,7 +216,7 @@ "x": 11, "y": 8, "elevation": 0, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 126 } ], diff --git a/data/maps/SecretBase_Tree1/map.json b/data/maps/SecretBase_Tree1/map.json index cd6a0b33a..43ece781a 100644 --- a/data/maps/SecretBase_Tree1/map.json +++ b/data/maps/SecretBase_Tree1/map.json @@ -216,7 +216,7 @@ "x": 5, "y": 7, "elevation": 0, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 126 } ], diff --git a/data/maps/SecretBase_Tree2/map.json b/data/maps/SecretBase_Tree2/map.json index 3aad151ff..f86f075f5 100644 --- a/data/maps/SecretBase_Tree2/map.json +++ b/data/maps/SecretBase_Tree2/map.json @@ -216,7 +216,7 @@ "x": 3, "y": 14, "elevation": 0, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 126 } ], diff --git a/data/maps/SecretBase_Tree3/map.json b/data/maps/SecretBase_Tree3/map.json index 498852c02..3f569bf11 100644 --- a/data/maps/SecretBase_Tree3/map.json +++ b/data/maps/SecretBase_Tree3/map.json @@ -216,7 +216,7 @@ "x": 8, "y": 6, "elevation": 0, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 126 } ], diff --git a/data/maps/SecretBase_Tree4/map.json b/data/maps/SecretBase_Tree4/map.json index b24d1d8a9..835cdd444 100644 --- a/data/maps/SecretBase_Tree4/map.json +++ b/data/maps/SecretBase_Tree4/map.json @@ -216,7 +216,7 @@ "x": 7, "y": 12, "elevation": 0, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 126 } ], diff --git a/data/maps/SecretBase_YellowCave1/map.json b/data/maps/SecretBase_YellowCave1/map.json index 54916fda3..d1a4aa3a1 100644 --- a/data/maps/SecretBase_YellowCave1/map.json +++ b/data/maps/SecretBase_YellowCave1/map.json @@ -216,7 +216,7 @@ "x": 5, "y": 7, "elevation": 0, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 126 } ], diff --git a/data/maps/SecretBase_YellowCave2/map.json b/data/maps/SecretBase_YellowCave2/map.json index f9d9a572b..e8317b95a 100644 --- a/data/maps/SecretBase_YellowCave2/map.json +++ b/data/maps/SecretBase_YellowCave2/map.json @@ -216,7 +216,7 @@ "x": 12, "y": 7, "elevation": 0, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 126 } ], diff --git a/data/maps/SecretBase_YellowCave3/map.json b/data/maps/SecretBase_YellowCave3/map.json index fdcc94c18..cc3405c93 100644 --- a/data/maps/SecretBase_YellowCave3/map.json +++ b/data/maps/SecretBase_YellowCave3/map.json @@ -216,7 +216,7 @@ "x": 5, "y": 9, "elevation": 0, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 126 } ], diff --git a/data/maps/SecretBase_YellowCave4/map.json b/data/maps/SecretBase_YellowCave4/map.json index 246974eaa..b6bb8914e 100644 --- a/data/maps/SecretBase_YellowCave4/map.json +++ b/data/maps/SecretBase_YellowCave4/map.json @@ -216,7 +216,7 @@ "x": 6, "y": 12, "elevation": 0, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 126 } ], diff --git a/data/maps/TerraCave_Entrance/map.json b/data/maps/TerraCave_Entrance/map.json index 1ddc768e2..5cb9f73b8 100644 --- a/data/maps/TerraCave_Entrance/map.json +++ b/data/maps/TerraCave_Entrance/map.json @@ -19,7 +19,7 @@ "x": 8, "y": 18, "elevation": 0, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 127 }, { diff --git a/data/maps/TradeCenter/map.json b/data/maps/TradeCenter/map.json index 0d3dd5477..31ed0f714 100644 --- a/data/maps/TradeCenter/map.json +++ b/data/maps/TradeCenter/map.json @@ -33,14 +33,14 @@ "x": 5, "y": 8, "elevation": 3, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 127 }, { "x": 6, "y": 8, "elevation": 3, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 127 } ], diff --git a/data/maps/Underwater_MarineCave/map.json b/data/maps/Underwater_MarineCave/map.json index c053fb121..e5daf244a 100644 --- a/data/maps/Underwater_MarineCave/map.json +++ b/data/maps/Underwater_MarineCave/map.json @@ -19,7 +19,7 @@ "x": 9, "y": 8, "elevation": 0, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 127 } ], diff --git a/data/maps/UnionRoom/map.json b/data/maps/UnionRoom/map.json index 3d19cd55f..c893c5788 100644 --- a/data/maps/UnionRoom/map.json +++ b/data/maps/UnionRoom/map.json @@ -137,14 +137,14 @@ "x": 7, "y": 11, "elevation": 3, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 127 }, { "x": 8, "y": 11, "elevation": 3, - "dest_map": "MAP_NONE", + "dest_map": "MAP_DYNAMIC", "dest_warp_id": 127 } ], diff --git a/include/constants/maps.h b/include/constants/maps.h index 2ad4ea8df..626054b43 100644 --- a/include/constants/maps.h +++ b/include/constants/maps.h @@ -3,14 +3,17 @@ #include "map_groups.h" -#define MAP_NONE (0x7F | (0x7F << 8)) +// Warps using this map will instead use the warp data stored in gSaveBlock1Ptr->dynamicWarp. +// Used for warps that need to change destinations, e.g. when stepping off an elevator. +#define MAP_DYNAMIC (0x7F | (0x7F << 8)) + #define MAP_UNDEFINED (0xFF | (0xFF << 8)) #define MAP_GROUP(map) (MAP_##map >> 8) #define MAP_NUM(map) (MAP_##map & 0xFF) // 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 +// are never read in practice. A dest_map of MAP_DYNAMIC 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. diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 2ba4c29cd..ed2830252 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -815,7 +815,7 @@ static void SetupWarp(struct MapHeader *unused, s8 warpEventId, struct MapPositi warpEvent = &gMapHeader.events->warps[warpEventId]; } - if (warpEvent->mapNum == MAP_NUM(NONE)) + if (warpEvent->mapNum == MAP_NUM(DYNAMIC)) { SetWarpDestinationToDynamicWarp(warpEvent->warpId); } @@ -826,7 +826,7 @@ static void SetupWarp(struct MapHeader *unused, s8 warpEventId, struct MapPositi SetWarpDestinationToMapWarp(warpEvent->mapGroup, warpEvent->mapNum, warpEvent->warpId); UpdateEscapeWarp(position->x, position->y); mapHeader = Overworld_GetMapHeaderByGroupAndId(warpEvent->mapGroup, warpEvent->mapNum); - if (mapHeader->events->warps[warpEvent->warpId].mapNum == MAP_NUM(NONE)) + if (mapHeader->events->warps[warpEvent->warpId].mapNum == MAP_NUM(DYNAMIC)) SetDynamicWarp(mapHeader->events->warps[warpEventId].warpId, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, warpEventId); } }