Merge pull request #9 from jonisavo/pokemon-use-hasItem

Refactor PokeBattle_Pokemon#hasItem? and use it instead of Object.isConst?
This commit is contained in:
Maruno17
2020-09-06 17:39:02 +01:00
committed by GitHub
9 changed files with 40 additions and 40 deletions

View File

@@ -823,7 +823,7 @@ def pbGiveItemToPokemon(item,pkmn,scene,pkmnid=0)
end
if pkmn.hasItem?
olditemname = PBItems.getName(pkmn.item)
if isConst?(pkmn.item,PBItems,:LEFTOVERS)
if pkmn.hasItem?(:LEFTOVERS)
scene.pbDisplay(_INTL("{1} is already holding some {2}.\1",pkmn.name,olditemname))
elsif newitemname.starts_with_vowel?
scene.pbDisplay(_INTL("{1} is already holding an {2}.\1",pkmn.name,olditemname))