Prevent the max speed of the fps camera to be less than 0

This commit is contained in:
Flakebi 2014-11-26 09:02:34 +01:00
parent c4cdfc4a0e
commit e4777d0c63

View File

@ -1044,7 +1044,10 @@ EventPropagation InputManager::input(const SEvent& event)
Camera *cam = Camera::getActiveCamera();
if (event.MouseInput.Wheel < 0)
{
cam->setMaximumVelocity(cam->getMaximumVelocity() - 3);
float vel = cam->getMaximumVelocity() - 3;
if (vel < 0.0f)
vel = 0.0f;
cam->setMaximumVelocity(vel);
}
else if (event.MouseInput.Wheel > 0)
{