historical/toontown-just-works.git/toontown/building/DistributedBuildingQueryMgrAI.py

18 lines
714 B
Python
Raw Normal View History

2024-01-16 11:20:27 -06:00
from direct.directnotify.DirectNotifyGlobal import directNotify
from direct.distributed import DistributedObjectAI
class DistributedBuildingQueryMgrAI(DistributedObjectAI.DistributedObjectAI):
notify = directNotify.newCategory('DistributedBuildingQueryMgrAI')
def __init__(self, air):
DistributedObjectAI.DistributedObjectAI.__init__(self, air)
self.buildings = {}
def isSuit(self, context, zoneId):
avId = self.air.getAvatarIdFromSender()
if zoneId not in self.buildings:
self.sendUpdateToAvatarId(avId, 'response', [context, False])
else:
self.sendUpdateToAvatarId(avId, 'response', [context, self.buildings[zoneId].isSuitBlock()])