Browse Source

kill crash 817829, crash on report when in boss battle

Redmond Urbino 17 years ago
parent
commit
ea863f74c2
1 changed files with 9 additions and 0 deletions
  1. 9 0
      direct/src/fsm/ClassicFSM.py

+ 9 - 0
direct/src/fsm/ClassicFSM.py

@@ -167,6 +167,15 @@ class ClassicFSM(DirectObject):
             ClassicFSM.notify.warning("[%s]: getStateNamed: %s, no such state" %
             ClassicFSM.notify.warning("[%s]: getStateNamed: %s, no such state" %
                                       (self.__name, stateName))
                                       (self.__name, stateName))
 
 
+    def hasStateNamed(self, stateName):
+        """
+        Return True if stateName is a valid state, False otherwise.
+        """
+        result = False
+        state = self.__states.get(stateName)
+        if state:
+            result = True
+        return result
 
 
     # basic ClassicFSM functionality
     # basic ClassicFSM functionality