From d6c98ea1a258c5afe761f13bf6206d521784fbc3 Mon Sep 17 00:00:00 2001 From: Little Cat Date: Mon, 9 Jan 2023 01:15:02 -0400 Subject: [PATCH] hood: Send street viszones on quiet zone on Astron This correctly mimics the same behavior on OTP, and improves teleporting to friends on streets. --- toontown/hood/QuietZoneState.py | 12 +++++++++++- toontown/town/Street.py | 4 ++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/toontown/hood/QuietZoneState.py b/toontown/hood/QuietZoneState.py index fc080ed..5efd693 100644 --- a/toontown/hood/QuietZoneState.py +++ b/toontown/hood/QuietZoneState.py @@ -281,9 +281,19 @@ class QuietZoneState(StateData.StateData): messenger.send(self.getEnterWaitForSetZoneResponseMsg(), [self._requestStatus]) base.cr.handlerArgs = self._requestStatus zoneId = self._requestStatus['zoneId'] + where = self._requestStatus['where'] base.cr.dumpAllSubShardObjects() base.cr.resetDeletedSubShardDoIds() - base.cr.sendSetZoneMsg(zoneId) + if __astron__ and where == 'street': + visZones = [ZoneUtil.getBranchZone(zoneId)] + # Assuming that the DNA have been loaded by bulk load before this. + loader = base.cr.playGame.hood.loader + visZones += [loader.node2zone[x] for x in loader.nodeDict[zoneId]] + if zoneId not in visZones: + visZones.append(zoneId) + base.cr.sendSetZoneMsg(zoneId, visZones) + else: + base.cr.sendSetZoneMsg(zoneId) self.waitForDatabase('WaitForSetZoneResponse') self.fsm.request('waitForSetZoneComplete') diff --git a/toontown/town/Street.py b/toontown/town/Street.py index cf2853e..0aa6b0a 100644 --- a/toontown/town/Street.py +++ b/toontown/town/Street.py @@ -352,8 +352,8 @@ class Street(BattlePlace.BattlePlace): if not __astron__: base.cr.sendSetZoneMsg(newZoneId) else: - visZones = [self.loader.node2zone[x] for x in self.loader.nodeDict[newZoneId]] - visZones.append(ZoneUtil.getBranchZone(newZoneId)) + visZones = [ZoneUtil.getBranchZone(newZoneId)] + visZones += [self.loader.node2zone[x] for x in self.loader.nodeDict[newZoneId]] if newZoneId not in visZones: visZones.append(newZoneId) base.cr.sendSetZoneMsg(newZoneId, visZones)