diff --git a/direct/src/distributed/DistributedObjectAI.py b/direct/src/distributed/DistributedObjectAI.py index bcd783c641..7fdc4c3ac8 100644 --- a/direct/src/distributed/DistributedObjectAI.py +++ b/direct/src/distributed/DistributedObjectAI.py @@ -329,7 +329,9 @@ class DistributedObjectAI(DistributedObjectBase, EnforcesCalldowns): def sendUpdate(self, fieldName, args = []): assert self.notify.debugStateCall(self) if self.air: - self.air.sendUpdate(self, fieldName, args) + dg = self.dclass.aiFormatUpdate( + fieldName, self.doId, self.doId, self.air.ourChannel, args) + self.air.sendDatagram(dg) def GetPuppetConnectionChannel(self, doId): return doId + (1L << 32) diff --git a/direct/src/showbase/PythonUtil.py b/direct/src/showbase/PythonUtil.py index ad87d8dc3b..336e80aead 100644 --- a/direct/src/showbase/PythonUtil.py +++ b/direct/src/showbase/PythonUtil.py @@ -3050,12 +3050,12 @@ if __debug__: def quickProfile(name="unnamed"): def profileDecorator(f): - if(not base.config.GetBool("use-profiler",0)): + if(not config.GetBool("use-profiler",0)): return f def _profiled(*args, **kArgs): # must do this in here because we don't have base/simbase # at the time that PythonUtil is loaded - if(not base.config.GetBool("profile-debug",0)): + if(not config.GetBool("profile-debug",0)): #dumb timings st=globalClock.getRealTime() f(*args,**kArgs) diff --git a/direct/src/task/Task.py b/direct/src/task/Task.py index 4f6b0b8324..1bb309ec4c 100644 --- a/direct/src/task/Task.py +++ b/direct/src/task/Task.py @@ -410,30 +410,26 @@ class TaskManager: def hasTaskNamed(self, taskName): # TODO: check pending task list # Get the tasks with this name - tasks = self.nameDict.get(taskName) # If we found some, see if any of them are still active (not removed) - if tasks: - for task in tasks: - if not task._removed: - return 1 + for task in self.nameDict.get(taskName, []): + if not task._removed: + return 1 # Didnt find any, return 0 return 0 def getTasksNamed(self, taskName): # TODO: check pending tasks # Get the tasks with this name - tasks = self.nameDict.get(taskName, []) - # Filter out the tasks that have been removed - if tasks: - tasks = filter(lambda task: not task._removed, tasks) - return tasks + return [task for task in self.nameDict.get(taskName, []) #grab all tasks with name + if not task._removed] #filter removed tasks def __doLaterFilter(self): # Filter out all the tasks that have been removed like a mark and # sweep garbage collector. Returns the number of tasks that have # been removed Warning: this creates an entirely new doLaterList. oldLen = len(self.__doLaterList) - self.__doLaterList = filter(lambda task: not task._removed, self.__doLaterList) + self.__doLaterList = [task for task in self.__doLaterList #grab all tasks with name + if not task._removed] #filter removed tasks # Re heapify to maintain ordering after filter heapify(self.__doLaterList) newLen = len(self.__doLaterList)