mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 21:57:57 +03:00
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:
parent
3d46bae1d0
commit
940ac789b9
1 changed files with 6 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue