diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2008-05-02 19:47:08 +0400 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2008-05-02 19:47:08 +0400 |
commit | f0a41d9d976f84db5c2c7cd6f2b38f7ce09642bd (patch) | |
tree | faf59643da89b050b654457bf106026e4457392c | |
parent | b846e7a3bf089de6808f517ec17c2cb447f764be (diff) |
Partially revert BGE bug fix #8863: don't send keyboard sensor positive pulse on level, this would badly interfere with keyboard sensors controlling set scene/restart scene actuators. Only send negative pulse on level to stop actuators after scene suspend
-rw-r--r-- | source/gameengine/GameLogic/SCA_KeyboardSensor.cpp | 19 | ||||
-rw-r--r-- | source/gameengine/GameLogic/SCA_MouseSensor.cpp | 6 |
2 files changed, 17 insertions, 8 deletions
diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp index 8a12bd298c2..f13b1bcf4c9 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp @@ -169,8 +169,10 @@ bool SCA_KeyboardSensor::Evaluate(CValue* eventval) { if (m_val == 0) { - m_val = 1; - result = true; + //see comment below + //m_val = 1; + //result = true; + ; } } else { @@ -220,10 +222,15 @@ bool SCA_KeyboardSensor::Evaluate(CValue* eventval) { if (m_val == 0) { - // this may occur during a scene suspend, the keyboard - // press was not captured, do it now - m_val = 1; - result = true; + //hmm, this abnormal situation may occur in the following cases: + //- the key was pressed while the scene was suspended + //- this is a new scene and the key is active from the start + //In the second case, it's dangerous to activate the sensor + //(think of a key to go to next scene) + //What we really need is a edge/level flag in the key sensor + //m_val = 1; + //result = true; + ; } } } diff --git a/source/gameengine/GameLogic/SCA_MouseSensor.cpp b/source/gameengine/GameLogic/SCA_MouseSensor.cpp index d8894ff593c..8810b7470ed 100644 --- a/source/gameengine/GameLogic/SCA_MouseSensor.cpp +++ b/source/gameengine/GameLogic/SCA_MouseSensor.cpp @@ -164,8 +164,10 @@ bool SCA_MouseSensor::Evaluate(CValue* event) { if (m_val == 0) { - m_val = 1; - result = true; + //dangerous + //m_val = 1; + //result = true; + ; } } else { |