Fixed softlock when opening menu

If you opened the fast travel or the item menu right before touching a
touch-run event, it would soft-lock you if the event changed niko's
move-route, since niko was unable to move due to his update function
being unreached.
This commit is contained in:
mshirt 2016-12-13 04:42:45 -06:00
parent f9a43eff45
commit 4fec45be25
3 changed files with 6 additions and 3 deletions

View file

@ -175,7 +175,7 @@ class Game_Player < Game_Character
# If moving, event running, move route forcing, and message window
# display are all not occurring
unless $game_system.map_interpreter.running? or @move_route_forcing or
$game_temp.message_window_showing
$game_temp.message_window_showing or $game_temp.menus_visible
# Adjust move speed
@move_speed = Input.press?(Input::RUN) ? 4 : 3
unless moving?
@ -235,7 +235,7 @@ class Game_Player < Game_Character
end
end
# If not moving
unless moving?
unless moving? or $game_temp.menus_visible
# If player was moving last time
if last_moving
# Event determinant is via touch of same position event

View file

@ -63,6 +63,7 @@ class Game_Temp
attr_accessor :footstep_sfx # current footstep sfx array
attr_accessor :filmsprite # film puzzle sprite
attr_accessor :prompt_wait # wait for delay caused by prompt
attr_accessor :menus_visible
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
@ -119,6 +120,7 @@ class Game_Temp
@footstep_sfx = nil
@filmsprite = nil
@prompt_wait = 0
@menus_visible = false
end
def bgm_fadein(game_system)

View file

@ -118,7 +118,8 @@ class Scene_Map
return
end
$game_system.map_interpreter.update
$game_player.update if !@menu.visible && !@item_menu.visible && !@fast_travel.visible
$game_temp.menus_visible = @menu.visible || @item_menu.visible || @fast_travel.visible
$game_player.update
$game_followers.each{|f| f.update}
# Update system (timer), screen
$game_system.update