diff --git a/Data/Scripts/007_Events and files/001_FileTests.rb b/Data/Scripts/007_Events and files/001_FileTests.rb index ea24e3789..68a6502be 100644 --- a/Data/Scripts/007_Events and files/001_FileTests.rb +++ b/Data/Scripts/007_Events and files/001_FileTests.rb @@ -131,9 +131,9 @@ def getKnownFolder(guid) packedGuid = guid.pack("VvvC*") shGetKnownFolderPath = Win32API.new("shell32.dll","SHGetKnownFolderPath","pllp","i") rescue nil coTaskMemFree = Win32API.new("ole32.dll","CoTaskMemFree","i","") rescue nil - return "" if !(shGetKnownFolderPath && coTaskMemFree) + return "" if !shGetKnownFolderPath || !coTaskMemFree path = "\0"*4 - path = shGetKnownFolderPath.call(packedGuid,0,0,path) + ret = shGetKnownFolderPath.call(packedGuid,0,0,path) path = path.unpack("V")[0] ret = getUnicodeString(path) coTaskMemFree.call(path) diff --git a/Data/Scripts/010_Scenes/003_Scene_Intro.rb b/Data/Scripts/010_Scenes/003_Scene_Intro.rb index 1cc032c8c..4ef94c738 100644 --- a/Data/Scripts/010_Scenes/003_Scene_Intro.rb +++ b/Data/Scripts/010_Scenes/003_Scene_Intro.rb @@ -17,7 +17,7 @@ class IntroEventScene < EventScene openPic(self,nil) end - def openPic(_scene,_args) + def openPic(_scene,*args) onCTrigger.clear @pic.name = "Graphics/Titles/"+@pics[@index] # fade to opacity 255 in FADE_TICKS ticks after waiting 0 frames @@ -49,7 +49,7 @@ class IntroEventScene < EventScene end end - def openSplash(_scene,_args) + def openSplash(_scene,*args) onUpdate.clear onCTrigger.clear @pic.name = "Graphics/Titles/"+@splash @@ -63,7 +63,7 @@ class IntroEventScene < EventScene onCTrigger.set(method(:closeSplash)) # call closeSplash when C key is pressed end - def closeSplash(scene,_args) + def closeSplash(scene,*args) onUpdate.clear onCTrigger.clear # Play random cry @@ -83,7 +83,7 @@ class IntroEventScene < EventScene sscreen.pbStartLoadScreen end - def closeSplashDelete(scene,_args) + def closeSplashDelete(scene,*args) onUpdate.clear onCTrigger.clear # Play random cry diff --git a/Data/Scripts/010_Scenes/004_Scene_Controls.rb b/Data/Scripts/010_Scenes/004_Scene_Controls.rb index 319218029..58b2b1003 100644 --- a/Data/Scripts/010_Scenes/004_Scene_Controls.rb +++ b/Data/Scripts/010_Scenes/004_Scene_Controls.rb @@ -37,7 +37,7 @@ class ButtonEventScene < EventScene onCTrigger.set(method(:pbOnScreen1)) end - def pbOnScreen1(scene,_args) + def pbOnScreen1(scene,*args) # End scene Graphics.freeze scene.dispose diff --git a/Data/Scripts/013_Overworld/015_PField_Time.rb b/Data/Scripts/013_Overworld/015_PField_Time.rb index e8d2548f8..1b2ddb14c 100644 --- a/Data/Scripts/013_Overworld/015_PField_Time.rb +++ b/Data/Scripts/013_Overworld/015_PField_Time.rb @@ -97,7 +97,7 @@ module PBDayNight # Internal function - def getToneInternal + def self.getToneInternal # Calculates the tone for the current frame, used for day/night effects realMinutes = pbGetDayNightMinutes hour = realMinutes/60 diff --git a/Data/Scripts/015_Items/001_PItem_Items.rb b/Data/Scripts/015_Items/001_PItem_Items.rb index 0004063ef..6c7145dec 100644 --- a/Data/Scripts/015_Items/001_PItem_Items.rb +++ b/Data/Scripts/015_Items/001_PItem_Items.rb @@ -902,7 +902,7 @@ end #=============================================================================== # Choose an item from the Bag #=============================================================================== -def pbChooseItem(var=0,_args) +def pbChooseItem(var=0,*args) ret = 0 pbFadeOutIn { scene = PokemonBag_Scene.new diff --git a/Data/Scripts/019_Other battles/001_PBattle_Safari.rb b/Data/Scripts/019_Other battles/001_PBattle_Safari.rb index a1b146b7d..a543758d7 100644 --- a/Data/Scripts/019_Other battles/001_PBattle_Safari.rb +++ b/Data/Scripts/019_Other battles/001_PBattle_Safari.rb @@ -52,7 +52,7 @@ end -Events.onMapChange += proc { |_sender,_args| +Events.onMapChange += proc { |_sender,*args| pbSafariState.pbEnd if !pbInSafari? } diff --git a/Data/Scripts/019_Other battles/003_PBattle_OrgBattle.rb b/Data/Scripts/019_Other battles/003_PBattle_OrgBattle.rb index b6fc4b54f..cc846814b 100644 --- a/Data/Scripts/019_Other battles/003_PBattle_OrgBattle.rb +++ b/Data/Scripts/019_Other battles/003_PBattle_OrgBattle.rb @@ -1,7 +1,7 @@ #=============================================================================== # Pokémon Organized Battle #=============================================================================== -def pbHasEligible?(_arg) +def pbHasEligible?(*arg) return pbBattleChallenge.rules.ruleset.hasValidTeam?($Trainer.party) end @@ -483,7 +483,7 @@ class BattleChallenge pbWriteCup(id,rules) end - def start(_args) + def start(*args) ensureType(@id) @currentChallenge=@id # must appear before pbStart @bc.pbStart(t,@numRounds) @@ -716,7 +716,7 @@ def pbBattleChallengeBeginSpeech end end -def pbEntryScreen(_arg) +def pbEntryScreen(*arg) retval = false pbFadeOutIn { scene = PokemonParty_Scene.new