From 631109536545e78c9d4db29c732857df9c75f70b Mon Sep 17 00:00:00 2001 From: John Cote Date: Wed, 8 Jan 2020 15:09:11 -0500 Subject: [PATCH] toon: add astron support checks to some code --- toontown/toon/DistributedToonAI.py | 42 ++++++++++++++++-------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/toontown/toon/DistributedToonAI.py b/toontown/toon/DistributedToonAI.py index 14c8d8d..65dae23 100644 --- a/toontown/toon/DistributedToonAI.py +++ b/toontown/toon/DistributedToonAI.py @@ -229,7 +229,8 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo if self.WantOldGMNameBan: self._checkOldGMName() messenger.send('avatarEntered', [self]) - self.sendUpdate('setDefaultShard', [self.air.districtId]) + if config.GetBool('astron-support', True): + self.sendUpdate('setDefaultShard', [self.air.districtId]) if hasattr(self, 'gameAccess') and self.gameAccess != 2: if self.hat[0] != 0: self.replaceItemInAccessoriesList(ToonDNA.HAT, 0, 0, 0, self.hat[0], self.hat[1], self.hat[2]) @@ -249,27 +250,28 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo self.b_setShoes(0, 0, 0) self.startPing() - def setLocation(self, parentId, zoneId): - DistributedPlayerAI.DistributedPlayerAI.setLocation(self, parentId, zoneId) - if self.isPlayerControlled(): - if 100 <= zoneId < ToontownGlobals.DynamicZonesBegin: - hood = ZoneUtil.getHoodId(zoneId) - self.sendUpdate('setLastHood', [hood]) - self.setDefaultZone(hood) - self.sendUpdate('setDefaultZone', [hood]) + if config.GetBool('astron-support', True): + def setLocation(self, parentId, zoneId): + DistributedPlayerAI.DistributedPlayerAI.setLocation(self, parentId, zoneId) + if self.isPlayerControlled(): + if 100 <= zoneId < ToontownGlobals.DynamicZonesBegin: + hood = ZoneUtil.getHoodId(zoneId) + self.sendUpdate('setLastHood', [hood]) + self.setDefaultZone(hood) + self.sendUpdate('setDefaultZone', [hood]) - canonicalZoneId = ZoneUtil.getCanonicalZoneId(zoneId) - canonicalHood = ZoneUtil.getHoodId(canonicalZoneId) - hoodsVisited = list(self.getHoodsVisited()) - if canonicalHood not in hoodsVisited: - hoodsVisited.append(canonicalHood) - self.b_setHoodsVisited(hoodsVisited) + canonicalZoneId = ZoneUtil.getCanonicalZoneId(zoneId) + canonicalHood = ZoneUtil.getHoodId(canonicalZoneId) + hoodsVisited = list(self.getHoodsVisited()) + if canonicalHood not in hoodsVisited: + hoodsVisited.append(canonicalHood) + self.b_setHoodsVisited(hoodsVisited) - if canonicalZoneId == ToontownGlobals.GoofySpeedway: - teleportAccess = self.getTeleportAccess() - if ToontownGlobals.GoofySpeedway not in teleportAccess: - teleportAccess.append(ToontownGlobals.GoofySpeedway) - self.b_setTeleportAccess(teleportAccess) + if canonicalZoneId == ToontownGlobals.GoofySpeedway: + teleportAccess = self.getTeleportAccess() + if ToontownGlobals.GoofySpeedway not in teleportAccess: + teleportAccess.append(ToontownGlobals.GoofySpeedway) + self.b_setTeleportAccess(teleportAccess) def _doDbCheck(self, task = None): self._dbCheckDoLater = None