SetShellSideArmCategory avoid div by zero (#7980)

This commit is contained in:
DizzyEggg 2025-10-19 20:40:34 +02:00 committed by GitHub
parent fb5f5b8f57
commit 51de48fc3f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11248,6 +11248,8 @@ void SetShellSideArmCategory(void)
statStage = gBattleMons[battlerDef].statStages[STAT_DEF];
targetDefStat *= gStatStageRatios[statStage][0];
targetDefStat /= gStatStageRatios[statStage][1];
if (targetDefStat == 0)
targetDefStat = 1;
physical = ((((2 * gBattleMons[battlerAtk].level / 5 + 2) * power * attackerAtkStat) / targetDefStat) / 50);
@ -11255,6 +11257,8 @@ void SetShellSideArmCategory(void)
statStage = gBattleMons[battlerDef].statStages[STAT_SPDEF];
targetSpDefStat *= gStatStageRatios[statStage][0];
targetSpDefStat /= gStatStageRatios[statStage][1];
if (targetSpDefStat == 0)
targetSpDefStat = 1;
special = ((((2 * gBattleMons[battlerAtk].level / 5 + 2) * power * attackerSpAtkStat) / targetSpDefStat) / 50);