Browse Source

add EventStorePandaNode

David Rose 19 years ago
parent
commit
8aaf640cd9
1 changed files with 9 additions and 1 deletions
  1. 9 1
      direct/src/showbase/EventManager.py

+ 9 - 1
direct/src/showbase/EventManager.py

@@ -7,6 +7,7 @@ from MessengerGlobal import *
 from direct.task.TaskManagerGlobal import taskMgr
 from direct.task.TaskManagerGlobal import taskMgr
 from direct.directnotify.DirectNotifyGlobal import *
 from direct.directnotify.DirectNotifyGlobal import *
 from direct.task.Task import Task
 from direct.task.Task import Task
+from pandac.PandaModules import *
 
 
 class EventManager:
 class EventManager:
 
 
@@ -54,7 +55,14 @@ class EventManager:
         else:
         else:
             # Must be some user defined type, return the ptr
             # Must be some user defined type, return the ptr
             # which will be downcast to that type
             # which will be downcast to that type
-            return eventParameter.getPtr()
+            ptr = eventParameter.getPtr()
+            
+            if isinstance(ptr, EventStorePandaNode):
+                # Actually, it's a kludgey wrapper around a PandaNode
+                # pointer.  Return the node.
+                ptr = ptr.getValue()
+
+            return ptr
         
         
     def processEvent(self, event):
     def processEvent(self, event):
         """
         """