From f2368993d7040c182e10cf85fe46e8d305c8999a Mon Sep 17 00:00:00 2001 From: Michael Shirt Date: Thu, 13 Oct 2016 18:27:06 -0600 Subject: [PATCH] Made get_user_name script function In the barrens during the prophet bot scene, the game was comparing the entered name to Oneshot::USER_NAME. But this was incorrect, as the name could be either the steam name or the pc username and the name has some preprocessing done to it. With this new script function, we can compare the name correctly --- scripts/Game_Oneshot.rb | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/scripts/Game_Oneshot.rb b/scripts/Game_Oneshot.rb index f007e91..cf34350 100644 --- a/scripts/Game_Oneshot.rb +++ b/scripts/Game_Oneshot.rb @@ -10,12 +10,7 @@ class Game_Oneshot if $GDC @player_name = '' else - user_name = (Steam.enabled? ? Steam::USER_NAME : Oneshot::USER_NAME).split(/\s+/) - if user_name[0].casecmp('the') == 0 || user_name[0].casecmp('a') == 0 - @player_name = user_name.join(' ') - else - @player_name = user_name[0] - end + @player_name = Game_Oneshot.get_user_name end @lights = {} @plight_timer = nil @@ -33,4 +28,12 @@ module Wallpaper $game_oneshot.wallpaper = nil Wallpaper.reset end + def self.get_user_name + user_name = (Steam.enabled? ? Steam::USER_NAME : Oneshot::USER_NAME).split(/\s+/) + if user_name[0].casecmp('the') == 0 || user_name[0].casecmp('a') == 0 + return user_name.join(' ') + else + return user_name[0] + end + end end