[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [14662] trunk/blender/source/gameengine/ GameLogic: 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.

Benoit Bolsee benoit.bolsee at online.be
Fri May 2 17:47:08 CEST 2008


Revision: 14662
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14662
Author:   ben2610
Date:     2008-05-02 17:47:08 +0200 (Fri, 02 May 2008)

Log Message:
-----------
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

Modified Paths:
--------------
    trunk/blender/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
    trunk/blender/source/gameengine/GameLogic/SCA_MouseSensor.cpp

Modified: trunk/blender/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
===================================================================
--- trunk/blender/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp	2008-05-02 15:45:15 UTC (rev 14661)
+++ trunk/blender/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp	2008-05-02 15:47:08 UTC (rev 14662)
@@ -169,8 +169,10 @@
 				{
 					if (m_val == 0)
 					{
-						m_val = 1;
-						result = true;
+						//see comment below
+						//m_val = 1;
+						//result = true;
+						;
 					}
 				} else
 				{
@@ -220,10 +222,15 @@
 					{
 						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;
+							;
 						}
 					}
 				}

Modified: trunk/blender/source/gameengine/GameLogic/SCA_MouseSensor.cpp
===================================================================
--- trunk/blender/source/gameengine/GameLogic/SCA_MouseSensor.cpp	2008-05-02 15:45:15 UTC (rev 14661)
+++ trunk/blender/source/gameengine/GameLogic/SCA_MouseSensor.cpp	2008-05-02 15:47:08 UTC (rev 14662)
@@ -164,8 +164,10 @@
 					{
 						if (m_val == 0)
 						{
-							m_val = 1;
-							result = true;
+							//dangerous
+							//m_val = 1;
+							//result = true;
+							;
 						}
 					} else
 					{





More information about the Bf-blender-cvs mailing list