From 18474edf5ab64df9b36eb6d518e9c3f3c93ac6ba Mon Sep 17 00:00:00 2001 From: John Cote Date: Tue, 29 Jun 2021 00:06:11 -0400 Subject: [PATCH] coghq: Fix interests crash --- toontown/coghq/CogHQExterior.py | 8 ++++++-- toontown/coghq/FactoryExterior.py | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/toontown/coghq/CogHQExterior.py b/toontown/coghq/CogHQExterior.py index bf1e10a..fe03834 100644 --- a/toontown/coghq/CogHQExterior.py +++ b/toontown/coghq/CogHQExterior.py @@ -149,8 +149,8 @@ class CogHQExterior(BattlePlace.BattlePlace): # Next, we need to collect all of the visgroup zone IDs. self.zoneVisDict = {} for i in range(dnaStore.getNumDNAVisGroupsAI()): - groupFullName = dnaStore.getDNAVisGroupName(i) visGroup = dnaStore.getDNAVisGroupAI(i) + groupFullName = visGroup.getName() visZoneId = int(base.cr.hoodMgr.extractGroupName(groupFullName)) visZoneId = ZoneUtil.getTrueZoneId(visZoneId, self.zoneId) visibles = [] @@ -161,4 +161,8 @@ class CogHQExterior(BattlePlace.BattlePlace): self.zoneVisDict[visZoneId] = visibles # Finally, we want interest in all visgroups due to this being a Cog HQ. - base.cr.sendSetZoneMsg(self.zoneId, list(self.zoneVisDict.values())[0]) + visList = list(self.zoneVisDict.values())[0] + if self.zoneId not in visList: + visList.append(self.zoneId) + + base.cr.sendSetZoneMsg(self.zoneId, visList) diff --git a/toontown/coghq/FactoryExterior.py b/toontown/coghq/FactoryExterior.py index d7f31cd..cb41613 100644 --- a/toontown/coghq/FactoryExterior.py +++ b/toontown/coghq/FactoryExterior.py @@ -168,8 +168,8 @@ class FactoryExterior(BattlePlace.BattlePlace): # Next, we need to collect all of the visgroup zone IDs. self.zoneVisDict = {} for i in range(dnaStore.getNumDNAVisGroupsAI()): - groupFullName = dnaStore.getDNAVisGroupName(i) visGroup = dnaStore.getDNAVisGroupAI(i) + groupFullName = visGroup.getName() visZoneId = int(base.cr.hoodMgr.extractGroupName(groupFullName)) visZoneId = ZoneUtil.getTrueZoneId(visZoneId, self.zoneId) visibles = [] @@ -180,4 +180,8 @@ class FactoryExterior(BattlePlace.BattlePlace): self.zoneVisDict[visZoneId] = visibles # Finally, we want interest in all visgroups due to this being a Cog HQ. - base.cr.sendSetZoneMsg(self.zoneId, list(self.zoneVisDict.values())[0]) + visList = list(self.zoneVisDict.values())[0] + if self.zoneId not in visList: + visList.append(self.zoneId) + + base.cr.sendSetZoneMsg(self.zoneId, visList)