From f73eb9eb84638befde954f0d549e7d74eb3ee072 Mon Sep 17 00:00:00 2001 From: John Cote Date: Wed, 8 Jan 2020 17:47:17 -0500 Subject: [PATCH] coghq: factory almost loads --- otp/level/Entity.py | 3 +-- otp/level/PropSpinner.py | 3 +-- toontown/coghq/FactoryInterior.py | 1 + toontown/coghq/LevelSuitPlannerAI.py | 3 ++- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/otp/level/Entity.py b/otp/level/Entity.py index cb87f1c..985dd84 100644 --- a/otp/level/Entity.py +++ b/otp/level/Entity.py @@ -1,6 +1,5 @@ from direct.showbase.DirectObject import DirectObject from direct.showbase.PythonUtil import lineInfo -import string from direct.directnotify import DirectNotifyGlobal class Entity(DirectObject): @@ -60,7 +59,7 @@ class Entity(DirectObject): return self.getZoneEntity().getNodePath() def privGetSetter(self, attrib): - setFuncName = 'set%s%s' % (string.upper(attrib[0]), attrib[1:]) + setFuncName = 'set%s%s' % (attrib[0].upper(), attrib[1:]) if hasattr(self, setFuncName): return getattr(self, setFuncName) return None diff --git a/otp/level/PropSpinner.py b/otp/level/PropSpinner.py index ba0d1a8..c1e5862 100644 --- a/otp/level/PropSpinner.py +++ b/otp/level/PropSpinner.py @@ -1,4 +1,3 @@ -import string from direct.interval.IntervalGlobal import * from .Entity import Entity from pandac.PandaModules import Vec3 @@ -22,7 +21,7 @@ class PropSpinner(Entity): nameParts = name.split('_') axis = nameParts[2] rate = 0 - neg = string.upper(nameParts[3][0]) == 'N' + neg = nameParts[3][0].upper() == 'N' if neg: nameParts[3] = nameParts[3][1:] try: diff --git a/toontown/coghq/FactoryInterior.py b/toontown/coghq/FactoryInterior.py index d88e634..2adcc17 100644 --- a/toontown/coghq/FactoryInterior.py +++ b/toontown/coghq/FactoryInterior.py @@ -3,6 +3,7 @@ from toontown.battle import BattlePlace from direct.fsm import ClassicFSM, State from direct.fsm import State from pandac.PandaModules import * +from libotp import * from otp.distributed.TelemetryLimiter import RotationLimitToH, TLGatherAllAvs from toontown.toon import Toon from toontown.toonbase import ToontownGlobals diff --git a/toontown/coghq/LevelSuitPlannerAI.py b/toontown/coghq/LevelSuitPlannerAI.py index 7f829fd..327a7be 100644 --- a/toontown/coghq/LevelSuitPlannerAI.py +++ b/toontown/coghq/LevelSuitPlannerAI.py @@ -4,6 +4,7 @@ from toontown.suit import SuitDNA from direct.directnotify import DirectNotifyGlobal from toontown.coghq import LevelBattleManagerAI import random +import functools class LevelSuitPlannerAI(DirectObject.DirectObject): notify = DirectNotifyGlobal.directNotify.newCategory('LevelSuitPlannerAI') @@ -39,7 +40,7 @@ class LevelSuitPlannerAI(DirectObject.DirectObject): for currChance in range(num): joinChances.append(random.randint(1, 100)) - joinChances.sort(cmp) + joinChances.sort(key=functools.cmp_to_key(cmp)) return joinChances def __genSuitInfos(self, level, track):