mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
don't allow DelayDeletes outside of generated states
This commit is contained in:
parent
dd6bfb30c5
commit
e7391fd489
@ -15,6 +15,16 @@ ESDisabled = 4 # values here and lower are considered "disabled"
|
|||||||
ESGenerating = 5 # values here and greater are considered "generated"
|
ESGenerating = 5 # values here and greater are considered "generated"
|
||||||
ESGenerated = 6
|
ESGenerated = 6
|
||||||
|
|
||||||
|
# update this table if the values above change
|
||||||
|
ESNum2Str = {
|
||||||
|
ESNew: 'ESNew',
|
||||||
|
ESDeleted: 'ESDeleted',
|
||||||
|
ESDisabling: 'ESDisabling',
|
||||||
|
ESDisabled: 'ESDisabed',
|
||||||
|
ESGenerating: 'ESGenerating',
|
||||||
|
ESGenerated: 'ESGenerated',
|
||||||
|
}
|
||||||
|
|
||||||
class DistributedObject(DistributedObjectBase):
|
class DistributedObject(DistributedObjectBase):
|
||||||
"""
|
"""
|
||||||
The Distributed Object class is the base class for all network based
|
The Distributed Object class is the base class for all network based
|
||||||
@ -166,6 +176,10 @@ class DistributedObject(DistributedObjectBase):
|
|||||||
|
|
||||||
def acquireDelayDelete(self, name):
|
def acquireDelayDelete(self, name):
|
||||||
# Also see DelayDelete.py
|
# Also see DelayDelete.py
|
||||||
|
if self.activeState not in (ESGenerating, ESGenerated):
|
||||||
|
self.notify.error(
|
||||||
|
'cannot acquire DelayDelete "%s" on %s because it is in state %s' % (
|
||||||
|
name, self.__class__.__name__, ESNum2Str[self.activeState]))
|
||||||
|
|
||||||
if self.getDelayDeleteCount() == 0:
|
if self.getDelayDeleteCount() == 0:
|
||||||
self.cr._addDelayDeletedDO(self)
|
self.cr._addDelayDeletedDO(self)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user