From db8f49bea82b4bb467b983349546feb2f7b29f42 Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 4 Jan 2005 21:32:58 +0000 Subject: [PATCH] add getCurrentOrNextState --- direct/src/fsm/FSM.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/direct/src/fsm/FSM.py b/direct/src/fsm/FSM.py index cd4c998e89..94bccf491e 100644 --- a/direct/src/fsm/FSM.py +++ b/direct/src/fsm/FSM.py @@ -132,6 +132,14 @@ class FSM(DirectObject.DirectObject): if self.state != 'Off': self.__setState('Off') + def getCurrentOrNextState(self): + # Returns the current state if we are in a state now, or the + # state we are transitioning into if we are currently within + # the enter or exit function for a state. + if self.state: + return self.state + return self.newState + def forceTransition(self, newState): """Changes unconditionally to the indicated state. This bypasses the filterState() function, and just calls