From 5814facc54bba9d334a7daf0b5ea315b08cd83b2 Mon Sep 17 00:00:00 2001 From: demiurgeQuantified <8355611+demiurgeQuantified@users.noreply.github.com> Date: Fri, 19 May 2023 23:43:37 +0100 Subject: [PATCH] trolley: fix new district crash when requesting a minigame --- toontown/spellbook/MagicWordIndex.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/toontown/spellbook/MagicWordIndex.py b/toontown/spellbook/MagicWordIndex.py index efe856f..39eddcb 100644 --- a/toontown/spellbook/MagicWordIndex.py +++ b/toontown/spellbook/MagicWordIndex.py @@ -335,7 +335,7 @@ class Minigame(MagicWord): mgId = None mgDiff = None if difficulty == 0 else difficulty mgKeep = None - mgSzId = ZoneUtil.getSafeZoneId(toon.zoneId) + mgSzId = ZoneUtil.getSafeZoneId(toon.zoneId) if isTeleport else None if not any ((isTeleport, isRequest)): return f"Unknown command or minigame \"{command}\". Valid commands: \"teleport\", \"request\", or a minigame to automatically teleport or request" @@ -350,9 +350,11 @@ class Minigame(MagicWord): mgId = ToontownGlobals.MinigameNames.get(minigame) if any((isTeleport, isRequest)): - if isTeleport and (ZoneUtil.isDynamicZone(toon.zoneId) or not toon.zoneId == mgSzId): - 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) + 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." + mgSzId = ToontownGlobals.ToontownCentral if ZoneUtil.isWelcomeValley(mgSzId) else mgSzId + MinigameCreatorAI.RequestMinigame[avId] = (mgId, mgKeep, mgDiff, mgSzId) if isTeleport: try: result = MinigameCreatorAI.createMinigame(self.air, [avId], mgSzId)