mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Fixed SystemStackError when loading a connected map with an event at its edge facing away from that edge
This commit is contained in:
@@ -65,8 +65,8 @@ class PokemonMapFactory
|
||||
return getMap(id, false)
|
||||
end
|
||||
|
||||
def getNewMap(playerX, playerY)
|
||||
id = $game_map.map_id
|
||||
def getNewMap(playerX, playerY, map_id = nil)
|
||||
id = map_id || $game_map.map_id
|
||||
MapFactoryHelper.eachConnectionForMap(id) do |conn|
|
||||
mapidB = nil
|
||||
newx = 0
|
||||
|
||||
@@ -211,8 +211,8 @@ class Game_Character
|
||||
end
|
||||
xbehind = @x + (@direction == 4 ? 1 : @direction == 6 ? -1 : 0)
|
||||
ybehind = @y + (@direction == 8 ? 1 : @direction == 2 ? -1 : 0)
|
||||
this_map = (self.map.valid?(@x, @y)) ? [self.map, @x, @y] : $map_factory&.getNewMap(@x, @y)
|
||||
behind_map = (self.map.valid?(xbehind, ybehind)) ? [self.map, xbehind, ybehind] : $map_factory&.getNewMap(xbehind, ybehind)
|
||||
this_map = (self.map.valid?(@x, @y)) ? [self.map, @x, @y] : $map_factory&.getNewMap(@x, @y, self.map.map_id)
|
||||
behind_map = (self.map.valid?(xbehind, ybehind)) ? [self.map, xbehind, ybehind] : $map_factory&.getNewMap(xbehind, ybehind, self.map.map_id)
|
||||
if this_map && this_map[0].deepBush?(this_map[1], this_map[2]) &&
|
||||
(!behind_map || behind_map[0].deepBush?(behind_map[1], behind_map[2]))
|
||||
@bush_depth = Game_Map::TILE_HEIGHT
|
||||
|
||||
Reference in New Issue
Block a user