mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
parentId added to generateWithRequiredAndId.
This commit is contained in:
parent
c27ec35667
commit
95f37c45c1
@ -302,22 +302,32 @@ class DistributedObjectAI(DirectObject.DirectObject):
|
|||||||
|
|
||||||
# this is a special generate used for estates, or anything else that
|
# this is a special generate used for estates, or anything else that
|
||||||
# needs to have a hard coded doId as assigned by the server
|
# needs to have a hard coded doId as assigned by the server
|
||||||
def generateWithRequiredAndId(self, doId, zoneId, optionalFields=[]):
|
if wantOtpServer:
|
||||||
assert self.notify.debugStateCall(self)
|
def generateWithRequiredAndId(self, doId, parentId, zoneId, optionalFields=[]):
|
||||||
# have we already allocated a doId?
|
assert self.notify.debugStateCall(self)
|
||||||
if self.__preallocDoId:
|
# have we already allocated a doId?
|
||||||
assert doId == self.__preallocDoId
|
if self.__preallocDoId:
|
||||||
self.__preallocDoId = 0
|
assert doId == self.__preallocDoId
|
||||||
|
self.__preallocDoId = 0
|
||||||
|
|
||||||
# The repository is the one that really does the work
|
# The repository is the one that really does the work
|
||||||
self.air.generateWithRequiredAndId(self, doId, zoneId, optionalFields)
|
self.air.generateWithRequiredAndId(self, doId, parentId, zoneId, optionalFields)
|
||||||
if wantOtpServer:
|
self.parentId = parentId
|
||||||
#HACK:
|
self.zoneId = zoneId
|
||||||
if not hasattr(self, 'parentId'):
|
self.__location = (parentId, zoneId)
|
||||||
parentId = self.air.districtId
|
self.generate()
|
||||||
self.parentId = parentId
|
else:
|
||||||
self.zoneId = zoneId
|
def generateWithRequiredAndId(self, doId, zoneId, optionalFields=[]):
|
||||||
self.generate()
|
assert self.notify.debugStateCall(self)
|
||||||
|
# have we already allocated a doId?
|
||||||
|
if self.__preallocDoId:
|
||||||
|
assert doId == self.__preallocDoId
|
||||||
|
self.__preallocDoId = 0
|
||||||
|
|
||||||
|
# The repository is the one that really does the work
|
||||||
|
self.air.generateWithRequiredAndId(self, doId, zoneId, optionalFields)
|
||||||
|
self.zoneId = zoneId
|
||||||
|
self.generate()
|
||||||
|
|
||||||
if wantOtpServer:
|
if wantOtpServer:
|
||||||
def generateOtpObject(self, parentId, zoneId, optionalFields=[], doId=None):
|
def generateOtpObject(self, parentId, zoneId, optionalFields=[], doId=None):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user