Change the current fov only if the fov is currently the selected fov

This prevents the player from modifying the fov while zooming
This commit is contained in:
smallmodel 2024-10-26 22:29:27 +02:00
parent 3d46bae1d0
commit 940ac789b9
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512

View file

@ -5871,13 +5871,18 @@ void Player::SetFov(float newFov)
void Player::EventSetSelectedFov(Event *ev)
{
float fOldSelectedFov;
if (ev->NumArgs() < 1) {
gi.SendServerCommand(edict - g_entities, "print \"Fov = %d\n\"", (unsigned int)fov);
return;
}
fOldSelectedFov = selectedfov;
SetSelectedFov(ev->GetFloat(1));
SetFov(selectedfov);
if (fov == fOldSelectedFov) {
SetFov(selectedfov);
}
}
void Player::SetSelectedFov(float newFov)