diff options
author | Jorge Bernal <jbernalmartinez@gmail.com> | 2015-03-13 02:48:28 +0300 |
---|---|---|
committer | Jorge Bernal <jbernalmartinez@gmail.com> | 2015-03-13 02:50:25 +0300 |
commit | 73ad76970ef8daf5933f7f5b6e8bc21341b7e358 (patch) | |
tree | 8b42b5c233747ab7499720d306ef4cacf6c9c776 /source | |
parent | 3db0e1ef6a7171456535fb661753a416d7b13417 (diff) |
BGE: Fix for T43980 MouseLook (actuator) triggers MouseMovement (sensor)
on other objects permanently
only trigger mouse event when it is necessary, this way we avoid
conflicts with other mouse sensors.
Diffstat (limited to 'source')
-rw-r--r-- | source/gameengine/Ketsji/KX_MouseActuator.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/gameengine/Ketsji/KX_MouseActuator.cpp b/source/gameengine/Ketsji/KX_MouseActuator.cpp index 62417b4df81..c372e6e9ce2 100644 --- a/source/gameengine/Ketsji/KX_MouseActuator.cpp +++ b/source/gameengine/Ketsji/KX_MouseActuator.cpp @@ -278,7 +278,10 @@ bool KX_MouseActuator::Update() setposition[1] = center_y; } - setMousePosition(setposition[0], setposition[1]); + // only trigger mouse event when it is necessary + if (m_oldposition[0] != position[0] || m_oldposition[1] != position[1]) { + setMousePosition(setposition[0], setposition[1]); + } m_oldposition[0] = position[0]; m_oldposition[1] = position[1]; |