coghq: fix some factory crashes

This commit is contained in:
John Cote 2020-01-08 20:10:31 -05:00
parent 80bda9a9ec
commit 77548ed278
3 changed files with 8 additions and 4 deletions

View file

@ -10,6 +10,7 @@ from toontown.ai.NewsManagerAI import NewsManagerAI
from toontown.ai.WelcomeValleyManagerAI import WelcomeValleyManagerAI from toontown.ai.WelcomeValleyManagerAI import WelcomeValleyManagerAI
from toontown.building.DistributedTrophyMgrAI import DistributedTrophyMgrAI from toontown.building.DistributedTrophyMgrAI import DistributedTrophyMgrAI
from toontown.catalog.CatalogManagerAI import CatalogManagerAI from toontown.catalog.CatalogManagerAI import CatalogManagerAI
from toontown.coghq.CogSuitManagerAI import CogSuitManagerAI
from toontown.coghq.FactoryManagerAI import FactoryManagerAI from toontown.coghq.FactoryManagerAI import FactoryManagerAI
from toontown.coghq.PromotionManagerAI import PromotionManagerAI from toontown.coghq.PromotionManagerAI import PromotionManagerAI
from toontown.distributed.ToontownDistrictAI import ToontownDistrictAI from toontown.distributed.ToontownDistrictAI import ToontownDistrictAI
@ -65,6 +66,7 @@ class ToontownAIRepository(ToontownInternalRepository):
self.cogPageManager = None self.cogPageManager = None
self.raceMgr = None self.raceMgr = None
self.factoryMgr = None self.factoryMgr = None
self.cogSuitMgr = None
self.timeManager = None self.timeManager = None
self.newsManager = None self.newsManager = None
self.welcomeValleyManager = None self.welcomeValleyManager = None
@ -138,6 +140,9 @@ class ToontownAIRepository(ToontownInternalRepository):
# Create our factory manager... # Create our factory manager...
self.factoryMgr = FactoryManagerAI(self) self.factoryMgr = FactoryManagerAI(self)
# Create our Cog suit manager...
self.cogSuitMgr = CogSuitManagerAI(self)
def createGlobals(self): def createGlobals(self):
""" """
Creates "global" (distributed) objects. Creates "global" (distributed) objects.

View file

@ -48,7 +48,7 @@ class DistributedGrid(BasicEntities.DistributedNodePathEntity):
long = self.numRow long = self.numRow
short = self.numCol short = self.numCol
h = 90 h = 90
self.model.setScale(scale * int, scale * short, 1) self.model.setScale(scale * long, scale * short, 1)
self.model.setHpr(h, 180, 0) self.model.setHpr(h, 180, 0)
self.model.setPos(self.cellSize * self.numCol / 2.0, self.cellSize * self.numRow / 2.0, 0.025) self.model.setPos(self.cellSize * self.numCol / 2.0, self.cellSize * self.numRow / 2.0, 0.025)
self.model.setColor(0.588, 0.588, 0.459, 0.4) self.model.setColor(0.588, 0.588, 0.459, 0.4)

View file

@ -10,7 +10,6 @@ from toontown.battle import BattleProps
from toontown.toonbase import TTLocalizer from toontown.toonbase import TTLocalizer
from pandac.PandaModules import VirtualFileMountHTTP, VirtualFileSystem, Filename, DSearchPath from pandac.PandaModules import VirtualFileMountHTTP, VirtualFileSystem, Filename, DSearchPath
from direct.showbase import AppRunnerGlobal from direct.showbase import AppRunnerGlobal
import string
import os import os
aSize = 6.06 aSize = 6.06
bSize = 5.29 bSize = 5.29
@ -928,7 +927,7 @@ class Suit(Avatar.Avatar):
else: else:
self.setSuitClothes(self.loseActor) self.setSuitClothes(self.loseActor)
else: else:
loseModel = 'phase_5/models/char/cog' + string.upper(self.style.body) + '_robot-lose-mod' loseModel = 'phase_5/models/char/cog' + self.style.body.upper() + '_robot-lose-mod'
filePrefix, phase = TutorialModelDict[self.style.body] filePrefix, phase = TutorialModelDict[self.style.body]
loseAnim = 'phase_' + str(phase) + filePrefix + 'lose' loseAnim = 'phase_' + str(phase) + filePrefix + 'lose'
self.loseActor = Actor.Actor(loseModel, {'lose': loseAnim}) self.loseActor = Actor.Actor(loseModel, {'lose': loseAnim})
@ -952,7 +951,7 @@ class Suit(Avatar.Avatar):
return return
def makeSkeleton(self): def makeSkeleton(self):
model = 'phase_5/models/char/cog' + string.upper(self.style.body) + '_robot-zero' model = 'phase_5/models/char/cog' + self.style.body.upper() + '_robot-zero'
anims = self.generateAnimDict() anims = self.generateAnimDict()
anim = self.getCurrentAnim() anim = self.getCurrentAnim()
dropShadow = self.dropShadow dropShadow = self.dropShadow