From 559caf104634d8ea7f6f3072f3db3b31f8a06b8f Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Sun, 3 Oct 2021 22:30:17 +0100 Subject: [PATCH] Fixed crash when walking into really tall grass on a connected map --- Data/Scripts/004_Game classes/007_Game_Character.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Data/Scripts/004_Game classes/007_Game_Character.rb b/Data/Scripts/004_Game classes/007_Game_Character.rb index ba66b528f..d9df26cc4 100644 --- a/Data/Scripts/004_Game classes/007_Game_Character.rb +++ b/Data/Scripts/004_Game classes/007_Game_Character.rb @@ -204,7 +204,8 @@ class Game_Character 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] : $MapFactory.getNewMap(@x, @y) - if this_map[0].deepBush?(this_map[1], this_map[2]) && self.map.deepBush?(xbehind, ybehind) + behind_map = (self.map.valid?(xbehind, ybehind)) ? [self.map, xbehind, ybehind] : $MapFactory.getNewMap(xbehind, ybehind) + if this_map[0].deepBush?(this_map[1], this_map[2]) && behind_map[0].deepBush?(behind_map[1], behind_map[2]) @bush_depth = Game_Map::TILE_HEIGHT elsif !moving? && this_map[0].bush?(this_map[1], this_map[2]) @bush_depth = 12