From e87f30a13591a37aa6376b503e2c936fb99b60a8 Mon Sep 17 00:00:00 2001 From: John Cote Date: Mon, 30 Dec 2019 20:29:56 -0500 Subject: [PATCH] battle: fix crash when battling cog --- toontown/battle/BattleBase.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/toontown/battle/BattleBase.py b/toontown/battle/BattleBase.py index b199f81..37f883a 100644 --- a/toontown/battle/BattleBase.py +++ b/toontown/battle/BattleBase.py @@ -2,6 +2,7 @@ from pandac.PandaModules import * from toontown.toonbase.ToontownBattleGlobals import * from direct.task.Timer import * import math +import functools from direct.directnotify import DirectNotifyGlobal from toontown.toon import NPCToons from toontown.toonbase import TTLocalizer @@ -157,7 +158,7 @@ def findToonAttack(toons, attacks, track): return -1 return 0 - foundAttacks.sort(compFunc) + foundAttacks.sort(key=functools.cmp_to_key(compFunc)) return foundAttacks