SetShellSideArmCategory avoid div by zero (#7980)
This commit is contained in:
parent
fb5f5b8f57
commit
51de48fc3f
@ -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);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user