diff --git a/Source/Client/Browser/BrowserCursor.cpp b/Source/Client/Browser/BrowserCursor.cpp index e1d83490..d87e18fd 100644 --- a/Source/Client/Browser/BrowserCursor.cpp +++ b/Source/Client/Browser/BrowserCursor.cpp @@ -29,7 +29,7 @@ void CWebBrowser::SetCursorState(int value) { void CWebBrowser::PollCursor() { POINT point; GetCursorPos(&point); - if (WindowFromPoint(point) != hWnd) { + if (hWnd != WindowFromPoint(point)) { if (this->cursorState != 1) { this->SetCursorState(1); } diff --git a/Source/Client/Input/Language.cpp b/Source/Client/Input/Language.cpp index 70632fb5..0bd63603 100644 --- a/Source/Client/Input/Language.cpp +++ b/Source/Client/Input/Language.cpp @@ -159,7 +159,7 @@ void CLanguageBase::CopySelection() { // OFFSET: 0x00ACD540 // FUNCTION: fn_17764 void CLanguageBase::Paste() { - if (g_windowMgr.GetHoverWindow() == g_windowMgr.window_4F1FC || g_windowMgr.LookupWindow(278) || g_windowMgr.LookupWindow(128)) { + if (g_windowMgr.window_4F1FC == g_windowMgr.GetHoverWindow() || g_windowMgr.LookupWindow(278) || g_windowMgr.LookupWindow(128)) { return; } diff --git a/Source/Client/Replay.cpp b/Source/Client/Replay.cpp index dfd20f48..4987832a 100644 --- a/Source/Client/Replay.cpp +++ b/Source/Client/Replay.cpp @@ -392,9 +392,9 @@ bool Replay::Cipher(std::uint32_t bytes, void* data) { auto* words = static_cast(data); this->cipherBase = this->header.key0 >> 5; + const int count = bytes / 4; this->cipherIndex = 0; this->cipherKey = this->header.key1 >> 3; - const int count = bytes / 4; for (int index = 0; index < count; ++index) { ++this->cipherIndex; diff --git a/Source/Contents/MessageTable.cpp b/Source/Contents/MessageTable.cpp index a0f4868d..d2c8a387 100644 --- a/Source/Contents/MessageTable.cpp +++ b/Source/Contents/MessageTable.cpp @@ -5061,7 +5061,7 @@ bool IsObfuscatedMessage(int id) { // FUNCTION: fn_18377 const char* GetMessageString(int id) { auto found = g_messageStrings.find(id); - if (found == g_messageStrings.end()) { + if (g_messageStrings.end() == found) { return ""; } diff --git a/Source/Contents/RenewQuestMgr.cpp b/Source/Contents/RenewQuestMgr.cpp index 7e0f9cea..aa79627e 100644 --- a/Source/Contents/RenewQuestMgr.cpp +++ b/Source/Contents/RenewQuestMgr.cpp @@ -333,7 +333,7 @@ std::string CRenewQuestMgr::GetMonsterConditionText(unsigned int flags, int minL // FUNCTION: fn_05441 std::string CRenewQuestMgr::GetIconTooltip(std::string_view icon) { const std::map::const_iterator found = this->m_iconTooltips.find(std::string(icon)); - return found != this->m_iconTooltips.end() ? found->second : std::string("QUEST"); + return this->m_iconTooltips.end() != found ? found->second : std::string("QUEST"); } // OFFSET: 0x006794D0 diff --git a/Source/UI/AdventureGuide/UIAdventureGuide.cpp b/Source/UI/AdventureGuide/UIAdventureGuide.cpp index 23423ab3..f6ec63ed 100644 --- a/Source/UI/AdventureGuide/UIAdventureGuide.cpp +++ b/Source/UI/AdventureGuide/UIAdventureGuide.cpp @@ -866,7 +866,7 @@ void CUIListBox::SelectItem(CUIListItem* item) { return; } for (AdventureGuide::CUISubTab* entry : this->items) { - if (entry != item) { + if (item != entry) { entry->SetSelected(false); } } @@ -890,7 +890,7 @@ void CUIListBox::SelectItem(CUIListItem* item) { return; } for (AdventureGuide::CUITab* entry : this->items) { - if (entry != item) { + if (item != entry) { entry->SetSelected(false); } } diff --git a/Source/UI/Buttons/UITagButton.cpp b/Source/UI/Buttons/UITagButton.cpp index c086cf68..bd8f3dbc 100644 --- a/Source/UI/Buttons/UITagButton.cpp +++ b/Source/UI/Buttons/UITagButton.cpp @@ -27,7 +27,7 @@ void UITagButton::Slot31(int x, int y) { return; } - if (g_windowMgr.Capture() != this) { + if (this != g_windowMgr.Capture()) { return; } diff --git a/Source/UI/Lists/UIDropDownBox.cpp b/Source/UI/Lists/UIDropDownBox.cpp index e8195164..08abba0a 100644 --- a/Source/UI/Lists/UIDropDownBox.cpp +++ b/Source/UI/Lists/UIDropDownBox.cpp @@ -28,7 +28,7 @@ void CUIDropDownBox::Detach() { // OFFSET: 0x009E3460 // FUNCTION: fn_14417 bool CUIDropDownBox::HasChild(const UIWindow* window) const { - return std::find(this->m_children.begin(), this->m_children.end(), window) != this->m_children.end(); + return this->m_children.end() != std::find(this->m_children.begin(), this->m_children.end(), window); } // OFFSET: 0x009E3490 diff --git a/Source/UI/Quest/UIRenewQuestUI.cpp b/Source/UI/Quest/UIRenewQuestUI.cpp index 87b08a0f..2f8a11fd 100644 --- a/Source/UI/Quest/UIRenewQuestUI.cpp +++ b/Source/UI/Quest/UIRenewQuestUI.cpp @@ -813,7 +813,7 @@ private: void CQuestItemSelector::SetHighlighted(CUIListItem* const& item) { CUIListItem* highlighted = item; for (RenewQuestUI::CUIQuestItem* entry : this->listBox->items) { - entry->SetHighlighted(static_cast(entry) == highlighted); + entry->SetHighlighted(highlighted == static_cast(entry)); } } diff --git a/Source/UI/RuneSystem/UIRuneSystemWnd.cpp b/Source/UI/RuneSystem/UIRuneSystemWnd.cpp index e6772eb8..01ebf75e 100644 --- a/Source/UI/RuneSystem/UIRuneSystemWnd.cpp +++ b/Source/UI/RuneSystem/UIRuneSystemWnd.cpp @@ -306,7 +306,7 @@ void UIRuneSetReWard::Slot31(int x, int y) { g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4201)), 0xFF, 0, 0, 0); } - if (g_windowMgr.Capture() == this) { + if (this == g_windowMgr.Capture()) { g_windowMgr.ReleaseCapture(); } } diff --git a/Source/UI/Text/ColoredText.cpp b/Source/UI/Text/ColoredText.cpp index 33842c05..81f58a06 100644 --- a/Source/UI/Text/ColoredText.cpp +++ b/Source/UI/Text/ColoredText.cpp @@ -277,5 +277,5 @@ std::string StripColorCodes(const char* text, unsigned bytes) { // OFFSET: 0x00A874B0 // FUNCTION: fn_17063 bool ContainsValue(const std::deque& values, const int& value) { - return std::find(values.begin(), values.end(), value) != values.end(); + return values.end() != std::find(values.begin(), values.end(), value); } diff --git a/Source/UI/Window/UIControl.cpp b/Source/UI/Window/UIControl.cpp index d1c48b9b..b7627468 100644 --- a/Source/UI/Window/UIControl.cpp +++ b/Source/UI/Window/UIControl.cpp @@ -1044,7 +1044,7 @@ void CUITab::Select(CUITabButton* button) { this->current = button; for (UIWindow* child : this->m_children) { - if (child != this->current) { + if (this->current != child) { static_cast(child)->SetSelected(false); } } diff --git a/Source/UI/Window/UIWindow.cpp b/Source/UI/Window/UIWindow.cpp index 065cba3a..d8c5ccbf 100644 --- a/Source/UI/Window/UIWindow.cpp +++ b/Source/UI/Window/UIWindow.cpp @@ -3393,7 +3393,7 @@ void UINavigationV4Wnd::InsertNavigationLink(std::string name, int x, int y) { // OFFSET: 0x005C4830 // FUNCTION: fn_03576 void UINavigationV4Wnd::RefreshLayout() { - if (g_navigationManager.unknown_1254) { + if (g_navigationManager.unknown_1254 == true) { this->Resize(134, 61); this->unknown_00B8->Move((this->geometry.width - 15), 2); this->unknown_00C4->Move((this->geometry.width - 32), 2);