Commit e7b23792 authored by cutealien's avatar cutealien

Prevent crashes in fps and maya camera animators when the device has no CursorControl

(still can't control those cameras without cursor certainly).


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5272 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 49b00b63
...@@ -82,7 +82,8 @@ bool CSceneNodeAnimatorCameraFPS::OnEvent(const SEvent& evt) ...@@ -82,7 +82,8 @@ bool CSceneNodeAnimatorCameraFPS::OnEvent(const SEvent& evt)
case EET_MOUSE_INPUT_EVENT: case EET_MOUSE_INPUT_EVENT:
if (evt.MouseInput.Event == EMIE_MOUSE_MOVED) if (evt.MouseInput.Event == EMIE_MOUSE_MOVED)
{ {
CursorPos = CursorControl->getRelativePosition(); if ( CursorControl )
CursorPos = CursorControl->getRelativePosition();
return true; return true;
} }
break; break;
......
...@@ -80,7 +80,10 @@ bool CSceneNodeAnimatorCameraMaya::OnEvent(const SEvent& event) ...@@ -80,7 +80,10 @@ bool CSceneNodeAnimatorCameraMaya::OnEvent(const SEvent& event)
MouseKeys[2] = event.MouseInput.isRightPressed(); MouseKeys[2] = event.MouseInput.isRightPressed();
MouseKeys[1] = event.MouseInput.isMiddlePressed(); MouseKeys[1] = event.MouseInput.isMiddlePressed();
MousePos = CursorControl->getRelativePosition(); if ( CursorControl )
{
MousePos = CursorControl->getRelativePosition();
}
break; break;
case EMIE_MOUSE_WHEEL: case EMIE_MOUSE_WHEEL:
case EMIE_LMOUSE_DOUBLE_CLICK: case EMIE_LMOUSE_DOUBLE_CLICK:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment