- 232
- Posts
- 8
- Years
- Seen May 15, 2025
[URGENT] Help me! I am about to release a version of my game and found a very horrible bug. It must be simple to solve but I don't know how to do it.
When my Pokémon passed out it sends the item to the backpack, but as soon as it revives, the same item remains held by it and ends up duplicating the same
IT'S VERY URGENT, HELP ME PLEASE, I WILL GIVE CREDITS FOR THAT
When my Pokémon passed out it sends the item to the backpack, but as soon as it revives, the same item remains held by it and ends up duplicating the same
Spoiler:
class PokeBattle_Battler
def pbFaint(showMessage=true)
unless fainted?
PBDebug.log("!!!***Can't faint with HP greater than 0")
return true
end
if @fainted
# PBDebug.log("!!!***Can't faint if already fainted")
return true
end
@battle.scene.pbFainted(self)
pbInitEffects(false)
# Reset status
self.status=0
self.statusCount=0
if @pokemon && @battle.internalbattle
@pokemon.changeHappiness("faint")
end
@pokemon.makeUnmega if self.isMega?
@pokemon.makeUnprimal if self.isPrimal?
@fainted=true
# reset choice
@battle.choices[@index]=[0,0,nil,-1]
pbOwnSide.effects[PBEffects::LastRoundFainted][email protected]
@battle.pbDisplayPaused(_INTL("{1} fainted!",pbThis)) if showMessage
if [email protected] && @pokemon.item >0 && showMessage
$PokemonBag.pbStoreItem(@pokemon.item,1)
itemname=PBItems.getName(@pokemon.item)
pocket=pbGetPocket(@pokemon.item)
@battle.pbDisplayPaused(_INTL("The wild {1} dropped\n{2} <icon=bagPocket#{pocket}> x 1!",@pokemon.name,itemname,@pokemon.item))
end
PBDebug.log("[Pokémon fainted] #{pbThis}")
return true
end
end
def pbFaint(showMessage=true)
unless fainted?
PBDebug.log("!!!***Can't faint with HP greater than 0")
return true
end
if @fainted
# PBDebug.log("!!!***Can't faint if already fainted")
return true
end
@battle.scene.pbFainted(self)
pbInitEffects(false)
# Reset status
self.status=0
self.statusCount=0
if @pokemon && @battle.internalbattle
@pokemon.changeHappiness("faint")
end
@pokemon.makeUnmega if self.isMega?
@pokemon.makeUnprimal if self.isPrimal?
@fainted=true
# reset choice
@battle.choices[@index]=[0,0,nil,-1]
pbOwnSide.effects[PBEffects::LastRoundFainted][email protected]
@battle.pbDisplayPaused(_INTL("{1} fainted!",pbThis)) if showMessage
if [email protected] && @pokemon.item >0 && showMessage
$PokemonBag.pbStoreItem(@pokemon.item,1)
itemname=PBItems.getName(@pokemon.item)
pocket=pbGetPocket(@pokemon.item)
@battle.pbDisplayPaused(_INTL("The wild {1} dropped\n{2} <icon=bagPocket#{pocket}> x 1!",@pokemon.name,itemname,@pokemon.item))
end
PBDebug.log("[Pokémon fainted] #{pbThis}")
return true
end
end
IT'S VERY URGENT, HELP ME PLEASE, I WILL GIVE CREDITS FOR THAT