From 73ad76970ef8daf5933f7f5b6e8bc21341b7e358 Mon Sep 17 00:00:00 2001 From: Jorge Bernal Date: Fri, 13 Mar 2015 00:48:28 +0100 Subject: 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. --- source/gameengine/Ketsji/KX_MouseActuator.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source') 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]; -- cgit v1.2.3