Don't start fireworks on AI start

This commit is contained in:
John 2015-07-02 17:04:31 +03:00
parent 82d0bc2038
commit bd580fdf2e

View file

@ -87,8 +87,7 @@ class NewsManagerAI(DistributedObjectAI):
messenger.send('checkBingoState') messenger.send('checkBingoState')
elif id in [ToontownGlobals.SUMMER_FIREWORKS, ToontownGlobals.NEW_YEAR_FIREWORKS]: elif id in [ToontownGlobals.SUMMER_FIREWORKS, ToontownGlobals.NEW_YEAR_FIREWORKS]:
if not self.fireworkTask: if not self.fireworkTask:
self.fireworkTask = taskMgr.doMethodLater(3600, self.startFireworks, 'newsFireworkTask', extraArgs=[id, Task.again]) self.fireworkTask = taskMgr.doMethodLater(3600, self.startFireworks, 'newsFireworkTask', extraArgs=[id])
taskMgr.doMethodLater(10, self.startFireworks, 'newsFireworkTask-initial', extraArgs=[id, Task.done])
def endSpecialHoliday(self, id): def endSpecialHoliday(self, id):
if id == ToontownGlobals.FISH_BINGO or id == ToontownGlobals.SILLY_SATURDAY: if id == ToontownGlobals.FISH_BINGO or id == ToontownGlobals.SILLY_SATURDAY:
@ -96,7 +95,7 @@ class NewsManagerAI(DistributedObjectAI):
elif id in [ToontownGlobals.SUMMER_FIREWORKS, ToontownGlobals.NEW_YEAR_FIREWORKS]: elif id in [ToontownGlobals.SUMMER_FIREWORKS, ToontownGlobals.NEW_YEAR_FIREWORKS]:
self.deleteFireworkTask() self.deleteFireworkTask()
def startFireworks(self, type, again, task=None): def startFireworks(self, type, task=None):
maxShow = len(FireworkShows.shows.get(type, [])) - 1 maxShow = len(FireworkShows.shows.get(type, [])) - 1
for hood in self.air.hoods: for hood in self.air.hoods:
@ -107,4 +106,4 @@ class NewsManagerAI(DistributedObjectAI):
fireworkShow.generateWithRequired(hood.zoneId) fireworkShow.generateWithRequired(hood.zoneId)
fireworkShow.b_startShow(type, random.randint(0, maxShow), globalClockDelta.getRealNetworkTime()) fireworkShow.b_startShow(type, random.randint(0, maxShow), globalClockDelta.getRealNetworkTime())
return again return Task.again