|
@@ -266,6 +266,12 @@
|
|
|
# functor creation is defered so initial state (sampled in functorFunc)
|
|
# functor creation is defered so initial state (sampled in functorFunc)
|
|
|
# will be appropriate for the time the lerp is spawned
|
|
# will be appropriate for the time the lerp is spawned
|
|
|
from TaskManagerGlobal import *
|
|
from TaskManagerGlobal import *
|
|
|
|
|
+
|
|
|
|
|
+ # upon death remove the functorFunc
|
|
|
|
|
+ def lerpUponDeath(task):
|
|
|
|
|
+ # Try to break circular references
|
|
|
|
|
+ del task.functorFunc
|
|
|
|
|
+ del task.lerp
|
|
|
|
|
|
|
|
# make the task function
|
|
# make the task function
|
|
|
def lerpTaskFunc(task):
|
|
def lerpTaskFunc(task):
|
|
@@ -283,7 +289,6 @@
|
|
|
if (task.lerp.isDone()):
|
|
if (task.lerp.isDone()):
|
|
|
# Reset the init flag, in case the task gets re-used
|
|
# Reset the init flag, in case the task gets re-used
|
|
|
task.init = 1
|
|
task.init = 1
|
|
|
- del task.functorFunc
|
|
|
|
|
return(Task.done)
|
|
return(Task.done)
|
|
|
else:
|
|
else:
|
|
|
return(Task.cont)
|
|
return(Task.cont)
|
|
@@ -294,6 +299,7 @@
|
|
|
lerpTask.functorFunc = functorFunc
|
|
lerpTask.functorFunc = functorFunc
|
|
|
lerpTask.duration = duration
|
|
lerpTask.duration = duration
|
|
|
lerpTask.blendType = self.__getBlend(blendType)
|
|
lerpTask.blendType = self.__getBlend(blendType)
|
|
|
|
|
+ lerpTask.uponDeath = lerpUponDeath
|
|
|
|
|
|
|
|
if (taskName == None):
|
|
if (taskName == None):
|
|
|
# don't spawn a task, return one instead
|
|
# don't spawn a task, return one instead
|