Fix infinite loop

This commit is contained in:
Eduardo Quezada D'Ottone 2021-10-10 08:46:31 -03:00
parent 7287560521
commit 01f563cb5e
2 changed files with 12 additions and 12 deletions

View File

@ -8022,41 +8022,41 @@ BattleScript_HangedOnMsgRet:
return
BattleScript_BerryConfuseHealEnd2::
jumpifability BS_ATTACKER, ABILITY_RIPEN, BattleScript_BerryConfuseHealEnd2_AbilityPopup
jumpifability BS_SCRIPTING, ABILITY_RIPEN, BattleScript_BerryConfuseHealEnd2_AbilityPopup
goto BattleScript_BerryConfuseHealEnd2_Anim
BattleScript_BerryConfuseHealEnd2_AbilityPopup:
call BattleScript_AbilityPopUp
BattleScript_BerryConfuseHealEnd2_Anim:
playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL
printstring STRINGID_PKMNSITEMRESTOREDHEALTH
waitmessage B_WAIT_TIME_LONG
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
healthbarupdate BS_SCRIPTING
datahpupdate BS_SCRIPTING
printstring STRINGID_FORXCOMMAYZ
waitmessage B_WAIT_TIME_LONG
setmoveeffect MOVE_EFFECT_CONFUSION | MOVE_EFFECT_AFFECTS_USER
seteffectprimary
removeitem BS_ATTACKER
removeitem BS_SCRIPTING
end2
BattleScript_BerryConfuseHealRet::
jumpifability BS_ATTACKER, ABILITY_RIPEN, BattleScript_BerryConfuseHealRet_AbilityPopup
jumpifability BS_SCRIPTING, ABILITY_RIPEN, BattleScript_BerryConfuseHealRet_AbilityPopup
goto BattleScript_BerryConfuseHealRet_Anim
BattleScript_BerryConfuseHealRet_AbilityPopup:
call BattleScript_AbilityPopUp
BattleScript_BerryConfuseHealRet_Anim:
playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL
printstring STRINGID_PKMNSITEMRESTOREDHEALTH
waitmessage B_WAIT_TIME_LONG
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
healthbarupdate BS_SCRIPTING
datahpupdate BS_SCRIPTING
printstring STRINGID_FORXCOMMAYZ
waitmessage B_WAIT_TIME_LONG
setmoveeffect MOVE_EFFECT_CONFUSION | MOVE_EFFECT_AFFECTS_USER
setmoveeffect MOVE_EFFECT_CONFUSION | MOVE_EFFECT_CERTAIN
seteffectprimary
removeitem BS_ATTACKER
removeitem BS_TARGET
return
BattleScript_BerryStatRaiseEnd2::

View File

@ -5574,7 +5574,7 @@ static u8 HealConfuseBerry(u32 battlerId, u32 itemId, u8 flavorId, bool32 end2)
gBattleMoveDamage *= 2;
gBattlerAbility = battlerId;
}
gBattleScripting.battler = battlerId;
if (end2)
{
if (GetFlavorRelationByPersonality(gBattleMons[battlerId].personality, flavorId) < 0)