Merge pull request #85 from demiurgeQuantified/trolley-crash-fixes

Trolley crash fixes
This commit is contained in:
Little Cat 2023-05-19 19:51:16 -03:00 committed by GitHub
commit e44c279364
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 5 deletions

View file

@ -11,7 +11,7 @@ from toontown.minigame import PlayingCardDeck
from toontown.minigame import PairingGameGlobals from toontown.minigame import PairingGameGlobals
from .OrthoWalk import OrthoWalk from .OrthoWalk import OrthoWalk
from .OrthoDrive import OrthoDrive from .OrthoDrive import OrthoDrive
from direct.interval.IntervalGlobal import Sequence, Parallel, Func, LerpColorScaleInterval, LerpScaleInterval, LerpFunctionInterval, Wait, SoundInterval from direct.interval.IntervalGlobal import Sequence, Parallel, Func, LerpColorScaleInterval, LerpScaleInterval, LerpFunctionInterval, Wait, SoundInterval, WaitInterval
from toontown.toonbase.ToontownGlobals import GlobalDialogColor from toontown.toonbase.ToontownGlobals import GlobalDialogColor
class DistributedPairingGame(DistributedMinigame): class DistributedPairingGame(DistributedMinigame):

View file

@ -350,9 +350,11 @@ class Minigame(MagicWord):
mgId = ToontownGlobals.MinigameNames.get(minigame) mgId = ToontownGlobals.MinigameNames.get(minigame)
if any((isTeleport, isRequest)): if any((isTeleport, isRequest)):
if isTeleport and (ZoneUtil.isDynamicZone(toon.zoneId) or not toon.zoneId == mgSzId): if isTeleport:
if ZoneUtil.isDynamicZone(toon.zoneId) or not toon.zoneId == mgSzId:
return "Target needs to be in a playground to teleport to a minigame." return "Target needs to be in a playground to teleport to a minigame."
MinigameCreatorAI.RequestMinigame[avId] = (mgId, mgKeep, mgDiff, ToontownGlobals.ToontownCentral if ZoneUtil.isWelcomeValley(mgSzId) else mgSzId) mgSzId = ToontownGlobals.ToontownCentral if ZoneUtil.isWelcomeValley(mgSzId) else mgSzId
MinigameCreatorAI.RequestMinigame[avId] = (mgId, mgKeep, mgDiff, mgSzId)
if isTeleport: if isTeleport:
try: try:
result = MinigameCreatorAI.createMinigame(self.air, [avId], mgSzId) result = MinigameCreatorAI.createMinigame(self.air, [avId], mgSzId)

View file

@ -1995,7 +1995,7 @@ class Toon(Avatar.Avatar, ToonHead):
def exitSitStart(self): def exitSitStart(self):
self.playingAnim = 'neutral' self.playingAnim = 'neutral'
if self.track != None: if self.track != None:
self.track.finish() self.track.pause()
DelayDelete.cleanupDelayDeletes(self.track) DelayDelete.cleanupDelayDeletes(self.track)
self.track = None self.track = None
Emote.globalEmote.releaseBody(self) Emote.globalEmote.releaseBody(self)