trolley: fix new district crash when requesting a minigame
This commit is contained in:
parent
5be4056d2f
commit
5814facc54
1 changed files with 6 additions and 4 deletions
|
@ -335,7 +335,7 @@ class Minigame(MagicWord):
|
||||||
mgId = None
|
mgId = None
|
||||||
mgDiff = None if difficulty == 0 else difficulty
|
mgDiff = None if difficulty == 0 else difficulty
|
||||||
mgKeep = None
|
mgKeep = None
|
||||||
mgSzId = ZoneUtil.getSafeZoneId(toon.zoneId)
|
mgSzId = ZoneUtil.getSafeZoneId(toon.zoneId) if isTeleport else None
|
||||||
|
|
||||||
if not any ((isTeleport, isRequest)):
|
if not any ((isTeleport, isRequest)):
|
||||||
return f"Unknown command or minigame \"{command}\". Valid commands: \"teleport\", \"request\", or a minigame to automatically teleport or request"
|
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)
|
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:
|
||||||
return "Target needs to be in a playground to teleport to a minigame."
|
if ZoneUtil.isDynamicZone(toon.zoneId) or not toon.zoneId == mgSzId:
|
||||||
MinigameCreatorAI.RequestMinigame[avId] = (mgId, mgKeep, mgDiff, ToontownGlobals.ToontownCentral if ZoneUtil.isWelcomeValley(mgSzId) else 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:
|
if isTeleport:
|
||||||
try:
|
try:
|
||||||
result = MinigameCreatorAI.createMinigame(self.air, [avId], mgSzId)
|
result = MinigameCreatorAI.createMinigame(self.air, [avId], mgSzId)
|
||||||
|
|
Loading…
Reference in a new issue