From 7efb374f757c96d7de230baed2b68d06f7f7bdfd Mon Sep 17 00:00:00 2001 From: David Cernat Date: Fri, 27 Jan 2017 10:41:10 +0200 Subject: [PATCH] [Client] Avoid fetching guiMessageBox.type again for every condition --- apps/openmw/mwmp/Networking.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwmp/Networking.cpp b/apps/openmw/mwmp/Networking.cpp index ba876315a..bb762a308 100644 --- a/apps/openmw/mwmp/Networking.cpp +++ b/apps/openmw/mwmp/Networking.cpp @@ -667,13 +667,15 @@ void Networking::processPlayerPacket(RakNet::Packet *packet) getLocalPlayer()->guiMessageBox.type, getLocalPlayer()->guiMessageBox.label.c_str()); - if (getLocalPlayer()->guiMessageBox.type == BasePlayer::GUIMessageBox::MessageBox) + int messageBoxType = getLocalPlayer()->guiMessageBox.type; + + if (messageBoxType == BasePlayer::GUIMessageBox::MessageBox) Main::get().getGUIController()->showMessageBox(getLocalPlayer()->guiMessageBox); - else if (getLocalPlayer()->guiMessageBox.type == BasePlayer::GUIMessageBox::CustomMessageBox) + else if (messageBoxType == BasePlayer::GUIMessageBox::CustomMessageBox) Main::get().getGUIController()->showCustomMessageBox(getLocalPlayer()->guiMessageBox); - else if (getLocalPlayer()->guiMessageBox.type == BasePlayer::GUIMessageBox::InputDialog) + else if (messageBoxType == BasePlayer::GUIMessageBox::InputDialog) Main::get().getGUIController()->showInputBox(getLocalPlayer()->guiMessageBox); - else if (getLocalPlayer()->guiMessageBox.type == BasePlayer::GUIMessageBox::ListBox) + else if (messageBoxType == BasePlayer::GUIMessageBox::ListBox) Main::get().getGUIController()->showDialogList(getLocalPlayer()->guiMessageBox); } break;