From 541fac8c6b9a530a95a38895152106ff9e71e9f4 Mon Sep 17 00:00:00 2001 From: nashmuhandes Date: Tue, 29 Aug 2017 00:39:03 +0800 Subject: [PATCH] Cleaned up and shorted the code for R_SetFOV. --- src/d_main.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/d_main.cpp b/src/d_main.cpp index 9d73b161a..5a97637ff 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -685,16 +685,12 @@ void D_Display () if (viewactive) { DAngle fov = 90.f; - if (players[consoleplayer].camera != nullptr) + AActor *cam = players[consoleplayer].camera; + if (cam) { - if (players[consoleplayer].camera && players[consoleplayer].camera->player) - { - fov = players[consoleplayer].camera->player->FOV; - } - else - { - fov = players[consoleplayer].camera->CameraFOV; - } + if (cam->player) + fov = cam->player->FOV; + else fov = cam->CameraFOV; } R_SetFOV(r_viewpoint, fov); }