mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Fixed Game Variables that are nil being treated as 0 instead, fixed missing error message when a required plugin is missing
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user