mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
proper solution when calling removeTask with a task name
This commit is contained in:
parent
923ff60d9f
commit
2716bc4cda
@ -63,7 +63,11 @@ class DirectObject:
|
|||||||
|
|
||||||
def removeTask(self, taskOrName):
|
def removeTask(self, taskOrName):
|
||||||
if type(taskOrName) == type(''):
|
if type(taskOrName) == type(''):
|
||||||
taskMgr.remove(taskOrName)
|
# we must use a copy, since task.remove will modify self._taskList
|
||||||
|
taskListValues = self._taskList.values()
|
||||||
|
for task in taskListValues:
|
||||||
|
if task.name == taskOrName:
|
||||||
|
task.remove()
|
||||||
else:
|
else:
|
||||||
taskOrName.remove()
|
taskOrName.remove()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user