Stop offering the route Pokemon Centers as fly destinations

This commit is contained in:
johnjohto
2026-08-04 12:28:08 -04:00
parent 1820f411ae
commit 6fe106f55c
6 changed files with 114 additions and 14 deletions
+18
View File
@@ -24,6 +24,13 @@ local NO_SHORE_TILESETS = { SHIP_PORT = true }
-- what counts as "outside" for the wLastMap memory (CheckIfInOutsideMap)
local OUTSIDE_TILESETS = { "OVERWORLD", "PLATEAU" }
-- pokered's fly destination gate: BuildFlyLocationsList
-- (engine/items/town_map.asm) walks map ids 0..NUM_CITY_MAPS-1, the eleven
-- towns PALLET_TOWN..SAFFRON_CITY, so routes never appear even though
-- ROUTE_4/ROUTE_10 carry fly-warp landing spots (those exist for the
-- dungeon-escape/heal tables, special_warps.asm FlyWarpDataPtr)
local NUM_CITY_MAPS = 11
-- warp pads and fall-through holes (data/tilesets/warp_pad_hole_tile_ids
-- .asm WarpPadAndHoleData); a tileset record carrying warpPadTiles
-- ({ [tileId] = "pad"|"hole" }) wins over these vanilla rows
@@ -153,6 +160,17 @@ function Map.isOutside(def, tilesets)
return false
end
-- FLY destination (LoadTownMap_Fly / BuildFlyLocationsList): the eleven
-- towns, map indices 0..NUM_CITY_MAPS-1. ROUTE_4 and ROUTE_10 are outdoor
-- and have fly warps but are not towns, so the outdoor test alone offered
-- their Pokemon Centers as fly targets (#788). Maps without a vanilla
-- index (mod-authored) keep the old outdoor/PLATEAU surface test, which is
-- how a mod adds its own fly town.
function Map.isFlyTown(def)
if def.index ~= nil then return def.index < NUM_CITY_MAPS end
return Map.isOutdoor(def) or def.tileset == "PLATEAU"
end
-- region groups maps a rule applies to without naming them; the id prefix
-- is the fallback for caches that predate the property
function Map.inRegion(def, region, prefix)
+6 -1
View File
@@ -364,7 +364,12 @@ function OverworldState:setMap(mapId, x, y, facing, opts)
Game.save.flashLit = nil
self:setDark(false)
end
if Game.data.field.flyWarps[mapId] then
-- MarkTownVisitedAndLoadToggleableObjects marks towns only (cp
-- FIRST_ROUTE_MAP): the fly-warp table also carries the ROUTE_4/ROUTE_10
-- Pokemon Centers and the dungeon escape spots, and entering those never
-- sets a wTownVisitedFlag bit, so it must not set save.visited either (#788)
local mapDef = Game.data.maps[mapId]
if Game.data.field.flyWarps[mapId] and mapDef and Map.isFlyTown(mapDef) then
Game.save.visited = Game.save.visited or {}
Game.save.visited[mapId] = true
end