- BGE, Some sensors, stored the event manager in 2 places (became confusing to do...
[blender.git] / source / gameengine / GameLogic / SCA_MouseSensor.cpp
index c5e1c3c0441f9086bc8412ea844f2e45b699c567..1a0a3939d54fe2c6e8d6048815d65e1397642f3e 100644 (file)
@@ -52,7 +52,6 @@ SCA_MouseSensor::SCA_MouseSensor(SCA_MouseManager* eventmgr,
                                                                 SCA_IObject* gameobj, 
                                                                 PyTypeObject* T)
     : SCA_ISensor(gameobj,eventmgr, T),
-       m_pMouseMgr(eventmgr),
        m_x(startx),
        m_y(starty)
 {
@@ -148,7 +147,7 @@ bool SCA_MouseSensor::Evaluate()
 {
        bool result = false;
        bool reset = m_reset && m_level;
-       SCA_IInputDevice* mousedev = m_pMouseMgr->GetInputDevice();
+       SCA_IInputDevice* mousedev = ((SCA_MouseManager *)m_eventmgr)->GetInputDevice();
 
        m_reset = false;
        switch (m_mousemode) {
@@ -283,7 +282,7 @@ KX_PYMETHODDEF_DOC_O(SCA_MouseSensor, getButtonStatus,
                        return NULL;
                }
                
-               SCA_IInputDevice* mousedev = m_pMouseMgr->GetInputDevice();
+               SCA_IInputDevice* mousedev = ((SCA_MouseManager *)m_eventmgr)->GetInputDevice();
                const SCA_InputEvent& event = mousedev->GetEventValue((SCA_IInputDevice::KX_EnumInputs) button);
                return PyInt_FromLong(event.m_status);
        }