Event Reciever occasionally crashes (rarely)
Posted: Thu Mar 04, 2004 5:28 am
Hey guys my program occasionally crashes at startup or when I am moving around my FPS camera fast. The debugger says the problem is in
(irrDevice != 0 && irrDevice->getSceneManager()->getActiveCamera())
I put in the "irrDevice != 0" becuase after I started using version 0.5 the program kept crashing because irrDevice was not initialised(though I do not know why the code would have worked in 4.0 if that was the case)
If you can see anything I am doing wrong let me know. Thanks!
(irrDevice != 0 && irrDevice->getSceneManager()->getActiveCamera())
I put in the "irrDevice != 0" becuase after I started using version 0.5 the program kept crashing because irrDevice was not initialised(though I do not know why the code would have worked in 4.0 if that was the case)
If you can see anything I am doing wrong let me know. Thanks!
Code: Select all
class MyEventReceiver : public IEventReceiver {
public:
virtual bool OnEvent(SEvent event) {
//Store Key input for control of objects and actions
keys[event.KeyInput.Key] = event.KeyInput.PressedDown;
//Debugger says problem is with line below
if(irrDevice != 0 && irrDevice->getSceneManager()->getActiveCamera()) {
return irrDevice->getSceneManager()->getActiveCamera()->OnEvent(event);
}
}
};