mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 21:24:59 +00:00
Fixed some maps being loaded when they shouldn't
This commit is contained in:
@@ -83,6 +83,7 @@ class PokemonMapFactory
|
|||||||
newy = conn[2] - conn[5] + playerY
|
newy = conn[2] - conn[5] + playerY
|
||||||
end
|
end
|
||||||
if newx >= 0 && newx < mapB[0] && newy >= 0 && newy < mapB[1]
|
if newx >= 0 && newx < mapB[0] && newy >= 0 && newy < mapB[1]
|
||||||
|
return [getMapNoAdd(mapidB), newx, newy] if map_id
|
||||||
return [getMap(mapidB), newx, newy]
|
return [getMap(mapidB), newx, newy]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -155,7 +156,7 @@ class PokemonMapFactory
|
|||||||
# Similar to Game_Player#passable?, but supports map connections
|
# Similar to Game_Player#passable?, but supports map connections
|
||||||
def isPassableFromEdge?(x, y)
|
def isPassableFromEdge?(x, y)
|
||||||
return true if $game_map.valid?(x, y)
|
return true if $game_map.valid?(x, y)
|
||||||
newmap = getNewMap(x, y)
|
newmap = getNewMap(x, y, $game_map.map_id)
|
||||||
return false if !newmap
|
return false if !newmap
|
||||||
return isPassable?(newmap[0].map_id, newmap[1], newmap[2])
|
return isPassable?(newmap[0].map_id, newmap[1], newmap[2])
|
||||||
end
|
end
|
||||||
@@ -373,10 +374,13 @@ class PokemonMapFactory
|
|||||||
return if $game_player.moving?
|
return if $game_player.moving?
|
||||||
if !MapFactoryHelper.hasConnections?($game_map.map_id)
|
if !MapFactoryHelper.hasConnections?($game_map.map_id)
|
||||||
return if @maps.length == 1
|
return if @maps.length == 1
|
||||||
@maps.delete_if { |map| $game_map.map_id != map.map_id }
|
@maps.delete_if { |map| map.map_id != $game_map.map_id }
|
||||||
@mapIndex = getMapIndex($game_map.map_id)
|
@mapIndex = getMapIndex($game_map.map_id)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
old_num_maps = @maps.length
|
||||||
|
@maps.delete_if { |map| !MapFactoryHelper.mapsConnected?($game_map.map_id, map.map_id) }
|
||||||
|
@mapIndex = getMapIndex($game_map.map_id) if @maps.length != old_num_maps
|
||||||
setMapsInRange
|
setMapsInRange
|
||||||
old_num_maps = @maps.length
|
old_num_maps = @maps.length
|
||||||
@maps.delete_if { |map| !MapFactoryHelper.mapInRange?(map) }
|
@maps.delete_if { |map| !MapFactoryHelper.mapInRange?(map) }
|
||||||
@@ -440,6 +444,13 @@ module MapFactoryHelper
|
|||||||
return conns[id] ? true : false
|
return conns[id] ? true : false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.mapsConnected?(id1, id2)
|
||||||
|
MapFactoryHelper.eachConnectionForMap(id1) { |conn|
|
||||||
|
return true if conn[0] == id2 || conn[3] == id2
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
def self.eachConnectionForMap(id)
|
def self.eachConnectionForMap(id)
|
||||||
conns = MapFactoryHelper.getMapConnections
|
conns = MapFactoryHelper.getMapConnections
|
||||||
return if !conns[id]
|
return if !conns[id]
|
||||||
|
|||||||
Reference in New Issue
Block a user