mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 22:24:58 +00:00
Made more use of nil_or_empty?, fixed incorrect default species body shape, fixed Illusion, fixed potential foreign Pokémon with blank names
This commit is contained in:
@@ -89,19 +89,19 @@ end
|
||||
|
||||
# Unused
|
||||
def hasConst?(mod,constant)
|
||||
return false if !mod || !constant || constant==""
|
||||
return false if !mod || nil_or_empty?(constant)
|
||||
return mod.const_defined?(constant.to_sym) rescue false
|
||||
end
|
||||
|
||||
# Unused
|
||||
def getConst(mod,constant)
|
||||
return nil if !mod || !constant || constant==""
|
||||
return nil if !mod || nil_or_empty?(constant)
|
||||
return mod.const_get(constant.to_sym) rescue nil
|
||||
end
|
||||
|
||||
# Unused
|
||||
def getID(mod,constant)
|
||||
return nil if !mod || !constant || constant==""
|
||||
return nil if !mod || nil_or_empty?(constant)
|
||||
if constant.is_a?(Symbol) || constant.is_a?(String)
|
||||
if (mod.const_defined?(constant.to_sym) rescue false)
|
||||
return mod.const_get(constant.to_sym) rescue 0
|
||||
|
||||
@@ -120,7 +120,7 @@ def pbAddForeignPokemon(pkmn, level = 1, owner_name = nil, nickname = nil, owner
|
||||
# Set original trainer to a foreign one
|
||||
pkmn.owner = Pokemon::Owner.new_foreign(owner_name || "", owner_gender)
|
||||
# Set nickname
|
||||
pkmn.name = nickname[0, Pokemon::MAX_NAME_SIZE]
|
||||
pkmn.name = nickname[0, Pokemon::MAX_NAME_SIZE] if !nil_or_empty?(nickname)
|
||||
# Recalculate stats
|
||||
pkmn.calc_stats
|
||||
if owner_name
|
||||
|
||||
@@ -68,7 +68,7 @@ end
|
||||
#===============================================================================
|
||||
def pbPlayTrainerIntroME(trainer_type)
|
||||
trainer_type_data = GameData::TrainerType.get(trainer_type)
|
||||
return if !trainer_type_data.intro_ME || trainer_type_data.intro_ME == ""
|
||||
return if nil_or_empty?(trainer_type_data.intro_ME)
|
||||
bgm = pbStringToAudioFile(trainer_type_data.intro_ME)
|
||||
pbMEPlay(bgm)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user