diff --git a/Data/Scripts/001_Technical/005_PluginManager.rb b/Data/Scripts/001_Technical/005_PluginManager.rb index 4c7a6771b..cf7f2b692 100644 --- a/Data/Scripts/001_Technical/005_PluginManager.rb +++ b/Data/Scripts/001_Technical/005_PluginManager.rb @@ -579,6 +579,8 @@ module PluginManager # clean the name to a simple string dname = dname[0] if dname.is_a?(Array) && dname.length == 2 dname = dname[1] if dname.is_a?(Array) && dname.length == 3 + # catch missing dependency + self.error("Plugin '#{o}' requires plugin '#{dname}' to work properly.") if !order.include?(dname) # skip if already sorted next if order.index(dname) > order.index(o) # catch looping dependency issue diff --git a/Data/Scripts/004_Game classes/001_Switches and Variables/002_Game_Switches.rb b/Data/Scripts/004_Game classes/001_Switches and Variables/002_Game_Switches.rb index 824ce8287..5dc91702f 100644 --- a/Data/Scripts/004_Game classes/001_Switches and Variables/002_Game_Switches.rb +++ b/Data/Scripts/004_Game classes/001_Switches and Variables/002_Game_Switches.rb @@ -4,7 +4,6 @@ # This class handles switches. It's a wrapper for the built-in class "Array." # Refer to "$game_switches" for the instance of this class. #=============================================================================== - class Game_Switches #----------------------------------------------------------------------------- # * Object Initialization @@ -17,11 +16,8 @@ class Game_Switches # switch_id : switch ID #----------------------------------------------------------------------------- def [](switch_id) - if switch_id<=5000 && @data[switch_id]!=nil - return @data[switch_id] - else - return false - end + return @data[switch_id] if switch_id <= 5000 && @data[switch_id] != nil + return false end #----------------------------------------------------------------------------- # * Set Switch @@ -29,8 +25,6 @@ class Game_Switches # value : ON (true) / OFF (false) #----------------------------------------------------------------------------- def []=(switch_id, value) - if switch_id<=5000 - @data[switch_id] = value - end + @data[switch_id] = value if switch_id <= 5000 end end diff --git a/Data/Scripts/004_Game classes/001_Switches and Variables/003_Game_Variables.rb b/Data/Scripts/004_Game classes/001_Switches and Variables/003_Game_Variables.rb index caacb764a..493a56f07 100644 --- a/Data/Scripts/004_Game classes/001_Switches and Variables/003_Game_Variables.rb +++ b/Data/Scripts/004_Game classes/001_Switches and Variables/003_Game_Variables.rb @@ -4,7 +4,6 @@ # This class handles variables. It's a wrapper for the built-in class "Array." # Refer to "$game_variables" for the instance of this class. #=============================================================================== - class Game_Variables #----------------------------------------------------------------------------- # * Object Initialization @@ -17,11 +16,8 @@ class Game_Variables # variable_id : variable ID #----------------------------------------------------------------------------- def [](variable_id) - if variable_id<=5000 && @data[variable_id]!=nil - return @data[variable_id] - else - return 0 - end + return @data[variable_id] if variable_id <= 5000 + return 0 end #----------------------------------------------------------------------------- # * Set Variable @@ -29,8 +25,6 @@ class Game_Variables # value : the variable's value #----------------------------------------------------------------------------- def []=(variable_id, value) - if variable_id<=5000 - @data[variable_id] = value - end + @data[variable_id] = value if variable_id <= 5000 end end diff --git a/Data/Scripts/004_Game classes/001_Switches and Variables/004_Game_SelfSwitches.rb b/Data/Scripts/004_Game classes/001_Switches and Variables/004_Game_SelfSwitches.rb index e39feed27..528e4b1c0 100644 --- a/Data/Scripts/004_Game classes/001_Switches and Variables/004_Game_SelfSwitches.rb +++ b/Data/Scripts/004_Game classes/001_Switches and Variables/004_Game_SelfSwitches.rb @@ -4,7 +4,6 @@ # This class handles self switches. It's a wrapper for the built-in class # "Hash." Refer to "$game_self_switches" for the instance of this class. #=============================================================================== - class Game_SelfSwitches #----------------------------------------------------------------------------- # * Object Initialization diff --git a/Data/Scripts/019_Utilities/001_Utilities.rb b/Data/Scripts/019_Utilities/001_Utilities.rb index 8a3d2b6f1..14483f1d8 100644 --- a/Data/Scripts/019_Utilities/001_Utilities.rb +++ b/Data/Scripts/019_Utilities/001_Utilities.rb @@ -479,7 +479,7 @@ end def pbConvertItemToPokemon(variable, array) item = GameData::Item.get(pbGet(variable)) - pbSet(variable, 0) + pbSet(variable, nil) for i in 0...(array.length / 2) next if item != array[2 * i] pbSet(variable, GameData::Species.get(array[2 * i + 1]).id) diff --git a/Data/Scripts/021_Compiler/001_Compiler.rb b/Data/Scripts/021_Compiler/001_Compiler.rb index d6bd4aa2d..086dcccfc 100644 --- a/Data/Scripts/021_Compiler/001_Compiler.rb +++ b/Data/Scripts/021_Compiler/001_Compiler.rb @@ -367,7 +367,7 @@ module Compiler elsif enumer.is_a?(Symbol) || enumer.is_a?(String) if GameData.const_defined?(enumer.to_sym) enumer = GameData.const_get(enumer.to_sym) - return nil if nil_or_empty?(re) || !enumer.exists?(ret.to_sym) + return nil if nil_or_empty?(ret) || !enumer.exists?(ret.to_sym) return ret.to_sym end enumer = Object.const_get(enumer.to_sym)