Skip to content

Commit

Permalink
Fix up null reference in OnDestroy
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchangelWTF committed Jul 11, 2024
1 parent f3244c4 commit 42a55e2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion DonutComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,10 @@ private void OnDestroy()
}
};

mainplayer.BeingHitAction -= BeingHitBattleCoolDown;
if(IsBotSpawningEnabled)
{
mainplayer.BeingHitAction -= BeingHitBattleCoolDown;
}

StopAllCoroutines();

Expand Down

0 comments on commit 42a55e2

Please sign in to comment.