diff --git a/asm/macros/event.inc b/asm/macros/event.inc index cea21aeb28..09ae12ab12 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 3c9887a65f..5c78145d27 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 a6eddc9a87..66613decb4 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 0ddc579fc7..63e4f0cb0d 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 9a3c43308f..dd6cb14f7d 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 083f444452..6bbf55a716 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 066cfb3857..21be99c9e3 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 b74fa5afb6..5b75d4d1ea 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 dd67e2d546..91828e9411 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 3c97371f53..1904761804 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 062eac9f4b..9a2b6db169 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 eb04f2a8de..6f949dd88f 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 1d00ee139a..4f64c516d1 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 f1fb82eb4f..592387ecc1 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 e83458a87a..f06d70b2e8 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 9a0ac210f4..6551387be5 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 ce405a40ab..85a74af001 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 2b1ad8c2c9..1540466654 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 a028cbe62a..1f6306b191 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 60977e70d4..fb1424d03d 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 a513b0bd2b..efdd0189f2 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 6aded553b8..98834ec665 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 cd6a0b33af..43ece781aa 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 3aad151ffe..f86f075f5c 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 498852c024..3f569bf11c 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 b24d1d8a99..835cdd4445 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 54916fda32..d1a4aa3a18 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 f9d9a572be..e8317b95ac 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 fdcc94c18b..cc3405c936 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 246974eaad..b6bb8914e5 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 1ddc768e27..5cb9f73b86 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 0d3dd5477b..31ed0f714c 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 c053fb1210..e5daf244ab 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 3d19cd55fc..c893c5788d 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 2ad4ea8df5..626054b43f 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 2ba4c29cd0..ed28302522 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); } }