minigame: fix more minigame crashes
This commit is contained in:
parent
7786de4334
commit
2ace6ce632
4 changed files with 9 additions and 8 deletions
|
@ -14,7 +14,6 @@ from toontown.char import Char
|
|||
from . import ArrowKeys
|
||||
import random
|
||||
from toontown.toonbase import ToontownGlobals
|
||||
import string
|
||||
from toontown.toonbase import TTLocalizer
|
||||
|
||||
class DistributedPatternGame(DistributedMinigame):
|
||||
|
@ -538,7 +537,7 @@ class DistributedPatternGame(DistributedMinigame):
|
|||
return self.__getRowPos(self.frontRowHome, self.frontRowXSpacing, index, len(self.avIdList))
|
||||
|
||||
def __setMinnieChat(self, str, giggle):
|
||||
str = string.replace(str, '%s', self.getAvatar(self.localAvId).getName())
|
||||
str = str.replace('%s', self.getAvatar(self.localAvId).getName())
|
||||
self.minnie.setChatAbsolute(str, CFSpeech)
|
||||
if giggle:
|
||||
self.minnie.playDialogue('statementA', 1)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
from direct.directnotify import DirectNotifyGlobal
|
||||
from pandac.PandaModules import *
|
||||
from libtoontown import *
|
||||
from toontown.toonbase.ToonBaseGlobal import *
|
||||
from .DistributedMinigame import *
|
||||
from direct.distributed.ClockDelta import *
|
||||
|
@ -292,10 +293,10 @@ class DistributedPhotoGame(DistributedMinigame, PhotoGameBase.PhotoGameBase):
|
|||
self.queue = CollisionHandlerQueue()
|
||||
self.traverser = CollisionTraverser('traverser name')
|
||||
self.rayArray = []
|
||||
vRange = (GOODROWS - BADROWS) / 2
|
||||
for row in range(-(GOODROWS / 2), GOODROWS / 2 + 1):
|
||||
for column in range(-(GOODROWS / 2), GOODROWS / 2 + 1):
|
||||
goodRange = list(range(-((GOODROWS - BADROWS) / 2), (GOODROWS - BADROWS) / 2 + 1))
|
||||
vRange = (GOODROWS - BADROWS) // 2
|
||||
for row in range(-(GOODROWS // 2), GOODROWS // 2 + 1):
|
||||
for column in range(-(GOODROWS // 2), GOODROWS // 2 + 1):
|
||||
goodRange = list(range(-((GOODROWS - BADROWS) // 2), (GOODROWS - BADROWS) // 2 + 1))
|
||||
rayQuality = 'g'
|
||||
if row not in goodRange or column not in goodRange:
|
||||
rayQuality = 'l'
|
||||
|
|
|
@ -821,7 +821,7 @@ class DistributedTargetGame(DistributedMinigame):
|
|||
open.setScale(1.5)
|
||||
closed = umbrella.find('**/closed_umbrella')
|
||||
closed.show()
|
||||
hand = toon.find('**/joint_Rhold')
|
||||
hand = toon.getRightHands()[0]
|
||||
ce = CompassEffect.make(NodePath(), CompassEffect.PRot)
|
||||
closed.node().setEffect(ce)
|
||||
closed.setHpr(0.0, 90.0, 35.0)
|
||||
|
|
|
@ -3,6 +3,7 @@ from direct.fsm import ClassicFSM, State
|
|||
from direct.fsm import State
|
||||
from . import TravelGameGlobals
|
||||
from toontown.toonbase import ToontownGlobals
|
||||
import functools
|
||||
|
||||
class DistributedTravelGameAI(DistributedMinigameAI):
|
||||
notify = directNotify.newCategory('DistributedTravelGameAI')
|
||||
|
@ -107,7 +108,7 @@ class DistributedTravelGameAI(DistributedMinigameAI):
|
|||
else:
|
||||
return 1
|
||||
|
||||
self.directionVotes.sort(voteCompare, reverse=True)
|
||||
self.directionVotes.sort(key=functools.cmp_to_key(voteCompare), reverse=True)
|
||||
winningVotes = self.directionVotes[0][1]
|
||||
self.winningDirections = []
|
||||
self.notify.debug('self.directionVotes = %s' % self.directionVotes)
|
||||
|
|
Loading…
Reference in a new issue