From 46a0c73e47e7c51a15fa2bf639be9ff803f7b1a9 Mon Sep 17 00:00:00 2001 From: Joe Shochet Date: Sat, 28 Oct 2006 01:19:11 +0000 Subject: [PATCH] added warning for doLater with negative delay time --- direct/src/task/Task.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/direct/src/task/Task.py b/direct/src/task/Task.py index 9423df584a..2440f21604 100644 --- a/direct/src/task/Task.py +++ b/direct/src/task/Task.py @@ -441,13 +441,14 @@ class TaskManager: def doMethodLater(self, delayTime, funcOrTask, name, extraArgs=None, priority=0, uponDeath=None, appendTask=False): + if delayTime < 0: + self.notify.warning('doMethodLater: added task: %s with negative delay: %s' % (name, delayTime)) if isinstance(funcOrTask, Task): task = funcOrTask elif callable(funcOrTask): task = Task(funcOrTask, priority) else: - self.notify.error( - 'add: Tried to add a task that was not a Task or a func') + self.notify.error('doMethodLater: Tried to add a task that was not a Task or a func') task.setPriority(priority) task.name = name task.extraArgs = extraArgs