From 0535668d09c94bc98f7740b1499c3aa77026f373 Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Tue, 15 Nov 2022 21:13:22 +0100 Subject: [PATCH] Optimize W3DPropBuffer::Draw_Props --- src/platform/w3dengine/client/w3dpropbuffer.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/platform/w3dengine/client/w3dpropbuffer.cpp b/src/platform/w3dengine/client/w3dpropbuffer.cpp index a0b989b8f..d4c4f91e1 100644 --- a/src/platform/w3dengine/client/w3dpropbuffer.cpp +++ b/src/platform/w3dengine/client/w3dpropbuffer.cpp @@ -208,16 +208,9 @@ void W3DPropBuffer::Draw_Props(RenderInfoClass &rinfo) if (m_props[i].is_visible && m_props[i].render_obj != nullptr) { if (g_thePlayerList == nullptr || g_thePartitionManager == nullptr) { m_props[i].shroud_status = SHROUDED_NONE; - } - - if (m_props[i].shroud_status == SHROUDED_INVALID) { - int index; - if (g_thePlayerList != nullptr) { - index = g_thePlayerList->Get_Local_Player()->Get_Player_Index(); - } else { - index = 0; - } + } else if (m_props[i].shroud_status == SHROUDED_INVALID) { + const int index = g_thePlayerList->Get_Local_Player()->Get_Player_Index(); m_props[i].shroud_status = g_thePartitionManager->Get_Prop_Shroud_Status_For_Player(index, &m_props[i].position);