From c8b594d38df8a2077bc2e3685f7317f2f6a6c73b Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Wed, 6 Oct 2021 00:00:12 +0100 Subject: [PATCH] Fixed crash when starting a new game --- Data/Scripts/004_Game classes/007_Game_Character.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Data/Scripts/004_Game classes/007_Game_Character.rb b/Data/Scripts/004_Game classes/007_Game_Character.rb index d9df26cc4..291409aa9 100644 --- a/Data/Scripts/004_Game classes/007_Game_Character.rb +++ b/Data/Scripts/004_Game classes/007_Game_Character.rb @@ -204,8 +204,9 @@ 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) - 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]) + 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 || 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