Automated proper enumeration of constants in GameData modules

This commit is contained in:
Maruno17
2020-12-12 21:50:33 +00:00
parent 9ceda78d37
commit 508b3fdf50
2 changed files with 4 additions and 6 deletions

View File

@@ -788,7 +788,7 @@ def pbSavePokemonData
has_param = !PBEvolution.hasFunction?(method, "parameterType") || param_type != nil
if has_param
if param_type
if [:Ability, :Item, :Move, :TrainerType, :Type].include?(param_type)
if GameData.const_defined?(param_type.to_sym)
pokedata.write("#{parameter.to_s}")
else
cparameter = (getConstantName(param_type, parameter) rescue parameter)
@@ -1236,7 +1236,7 @@ def pbSavePokemonFormsData
has_param = !PBEvolution.hasFunction?(method, "parameterType") || param_type != nil
if has_param
if param_type
if [:Ability, :Item, :Move, :TrainerType, :Type].include?(param_type)
if GameData.const_defined?(param_type.to_sym)
pokedata.write("#{parameter.to_s}")
else
cparameter = (getConstantName(param_type, parameter) rescue parameter)