Skip to content

Commit

Permalink
Fix safari zone crash on No Cash
Browse files Browse the repository at this point in the history
  • Loading branch information
DizzyEggg authored Jan 28, 2025
1 parent f3f03ec commit 7d280ae
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/battle_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -11972,6 +11972,10 @@ void SetShellSideArmCategory(void)
u32 physical;
u32 special;

// Don't run this check for Safari Battles. Because player's stats are zeroed out, this performs division by zero which previously would crash on certain emulators in Safari Zone.
if (gBattleTypeFlags & BATTLE_TYPE_SAFARI)
return;

for (battlerAtk = 0; battlerAtk < gBattlersCount; battlerAtk++)
{
attackerAtkStat = gBattleMons[battlerAtk].attack;
Expand Down

0 comments on commit 7d280ae

Please sign in to comment.