diff --git a/Source/Client/Browser/BrowserFrame.cpp b/Source/Client/Browser/BrowserFrame.cpp index 60eba9e60..09844183f 100644 --- a/Source/Client/Browser/BrowserFrame.cpp +++ b/Source/Client/Browser/BrowserFrame.cpp @@ -9,7 +9,7 @@ void CWebBrowser::Normalize() { RECT rectangle; GetWindowRect(this->browserWindow, &rectangle); - if (rectangle.right - rectangle.left != this->screenWidth || rectangle.bottom - rectangle.top != this->screenHeight) { + if (this->screenWidth != rectangle.right - rectangle.left || this->screenHeight != rectangle.bottom - rectangle.top) { return; } diff --git a/Source/Client/Input/VietnameseInput.cpp b/Source/Client/Input/VietnameseInput.cpp index 1e1e0cac5..11c8b47dc 100644 --- a/Source/Client/Input/VietnameseInput.cpp +++ b/Source/Client/Input/VietnameseInput.cpp @@ -79,7 +79,7 @@ int TELEXInputMode::Convert(char key, char vowel, int index) { int TELEXInputMode::IsModifierKey(char key, int count, char vowel) { if (key != vowel && key != 'w' && key != 'W') { int tone = 0; - while (key != g_telexToneKeys[tone] && tone < 5) { + while (g_telexToneKeys[tone] != key && tone < 5) { ++tone; } if (tone >= 5) { diff --git a/Source/Client/Stove/StoveMgr.cpp b/Source/Client/Stove/StoveMgr.cpp index 5a76cbb41..5c986e242 100644 --- a/Source/Client/Stove/StoveMgr.cpp +++ b/Source/Client/Stove/StoveMgr.cpp @@ -477,7 +477,7 @@ void ConfirmPurchaseCallback::operator()(Stove::PCSDK::CallbackResult callbackRe // OFFSET: 0x0063DB80 // FUNCTION: fn_04794 void CSession::AddItem1784(const ITEM_INFO& item, int list) { - if (static_cast(list) < 11) { + if (static_cast(list) <= 10) { this->unknown_1784[list].push_back(item); } } diff --git a/Source/Contents/ActorGeometry.cpp b/Source/Contents/ActorGeometry.cpp index 6170f5f5d..caf58161e 100644 --- a/Source/Contents/ActorGeometry.cpp +++ b/Source/Contents/ActorGeometry.cpp @@ -37,7 +37,7 @@ float __stdcall CRenderObject::Heading(float x, float z, float targetX, float ta void CRenderObject::Face(float x, float z) { const float deltaX = x - this->render.position.x; const float deltaZ = z - this->render.position.z; - if (deltaX != 0.0f || deltaZ != 0.0f) { + if (0.0f != deltaX || 0.0f != deltaZ) { float angle = (static_cast(std::atan2(static_cast(deltaX), static_cast(-deltaZ))) / 3.141592f) * 180.0f; this->render.angle = angle; if (angle >= 360.0f) { diff --git a/Source/Contents/GuildInfo.cpp b/Source/Contents/GuildInfo.cpp index 60142cbe6..6b01f1d70 100644 --- a/Source/Contents/GuildInfo.cpp +++ b/Source/Contents/GuildInfo.cpp @@ -250,7 +250,7 @@ void GuildInfo::UpdateCharacterName(int characterId, const char* name) { // FUNCTION: fn_18045 void GuildInfo::UpdateMemberStatus(int accountId, int online, int characterId, short unknown_002C, short unknown_0020, short unknown_0024) { for (auto it = this->m_members.begin(); it != this->m_members.end(); ++it) { - if (it->characterId == characterId) { + if (characterId == it->characterId) { it->unknown_002C = unknown_002C; it->unknown_0020 = unknown_0020; it->unknown_0024 = unknown_0024; @@ -273,7 +273,7 @@ void GuildInfo::UpdateMemberStatus(int accountId, int online, int characterId, s // FUNCTION: fn_18046 void GuildInfo::SetMemberOnline(int accountId, int online) { for (auto it = this->m_members.begin(); it != this->m_members.end(); ++it) { - if (it->accountId == accountId) { + if (accountId == it->accountId) { it->online = online; break; } diff --git a/Source/Contents/Items/BarterMarketItemMgr.cpp b/Source/Contents/Items/BarterMarketItemMgr.cpp index c0caaecd2..12b44cbb1 100644 --- a/Source/Contents/Items/BarterMarketItemMgr.cpp +++ b/Source/Contents/Items/BarterMarketItemMgr.cpp @@ -353,7 +353,7 @@ int CBarterMarketItemMgr::GetAllItemValueByName(std::string name) int CBarterMarketItemMgr::GetAmountById(int id) { for (std::list::iterator it = this->items.begin(); it != this->items.end(); ++it) { - if (it->id == id) { + if (id == it->id) { return it->amount; } } @@ -554,7 +554,7 @@ std::pair CExpandedBarterMarketItemMgr::FindEntry(int i int CExpandedBarterMarketItemMgr::GetItemValueById(int id) { for (std::vector::iterator it = this->items.begin(); it != this->items.end(); ++it) { - if (it->id == id) { + if (id == it->id) { return it->value; } } @@ -566,7 +566,7 @@ int CExpandedBarterMarketItemMgr::GetItemValueById(int id) float CExpandedBarterMarketItemMgr::GetItemFactorById(int id) { for (std::vector::iterator it = this->items.begin(); it != this->items.end(); ++it) { - if (it->id == id) { + if (id == it->id) { return it->factor; } } @@ -592,7 +592,7 @@ int CExpandedBarterMarketItemMgr::GetEntryCount() int CExpandedBarterMarketItemMgr::GetValueById(int id) { for (std::vector::iterator it = this->entries.begin(); it != this->entries.end(); ++it) { - if (it->id == id) { + if (id == it->id) { return it->value; } } diff --git a/Source/Contents/Items/RuneSystem.cpp b/Source/Contents/Items/RuneSystem.cpp index 5528c667e..10af84432 100644 --- a/Source/Contents/Items/RuneSystem.cpp +++ b/Source/Contents/Items/RuneSystem.cpp @@ -124,7 +124,7 @@ void CRuneSystemMgr::AddRune(int tagId, int type, std::int64_t id, const std::st // FUNCTION: fn_08113 void CTagData::UpdateActiveCount(int type) { this->m_activeCount[type] = 0; - for (std::vector::iterator it = this->m_runes[type].begin(); it != this->m_runes[type].end(); ++it) { + for (std::vector::iterator it = this->m_runes[type].begin(); this->m_runes[type].end() != it; ++it) { if (*it) { this->m_activeCount[type] += (*it)->IsActive(); } diff --git a/Source/Contents/Skills/ClientSkills.cpp b/Source/Contents/Skills/ClientSkills.cpp index f7486d464..26caad306 100644 --- a/Source/Contents/Skills/ClientSkills.cpp +++ b/Source/Contents/Skills/ClientSkills.cpp @@ -285,7 +285,7 @@ bool CSession::UpdateSkill(const CSkillInfo& value, unsigned char notify, unsign // FUNCTION: fn_23740 bool CSession::UpdateAdditionalSkill(const CSkillInfo& value, int) { for (CSkillInfo& skill : this->m_additionalSkills) { - if (skill.id == value.id) { + if (value.id == skill.id) { skill.level = value.level; std::memcpy(&skill.unknown_0014, &value.unknown_0014, sizeof(skill.unknown_0014)); std::memcpy(&skill.unknown_001C, &value.unknown_001C, sizeof(skill.unknown_001C)); @@ -304,7 +304,7 @@ bool CSession::UpdateAdditionalSkill(const CSkillInfo& value, int) { // FUNCTION: fn_23741 bool CSession::UpdateHomunSkill(const CSkillInfo& value, unsigned char notify) { for (CSkillInfo& skill : this->m_homunSkills) { - if (skill.id == value.id) { + if (value.id == skill.id) { skill.level = value.level; skill.unknown_0014 = value.unknown_0014; skill.unknown_001C = value.unknown_001C; @@ -331,7 +331,7 @@ bool CSession::UpdateHomunSkill(const CSkillInfo& value, unsigned char notify) { // FUNCTION: fn_23742 bool CSession::UpdateMercSkill(const CSkillInfo& value, unsigned char notify) { for (CSkillInfo& skill : this->m_mercSkills) { - if (skill.id == value.id) { + if (value.id == skill.id) { skill.level = value.level; skill.unknown_0014 = value.unknown_0014; skill.unknown_001C = value.unknown_001C; @@ -675,7 +675,7 @@ int CSession::GetDefaultOptionValue(const char* name, int fallback) const { // FUNCTION: fn_23777 int CSession::FindUnknown0778(int key) const { for (const std::pair& entry : this->unknown_0778) { - if (entry.first == key) { + if (key == entry.first) { return entry.second; } } diff --git a/Source/Contents/Skills/PlayerSkillBundle.cpp b/Source/Contents/Skills/PlayerSkillBundle.cpp index 0ef03e586..d32a53510 100644 --- a/Source/Contents/Skills/PlayerSkillBundle.cpp +++ b/Source/Contents/Skills/PlayerSkillBundle.cpp @@ -120,7 +120,7 @@ bool CPlayerSkillBundle::FindIndexed(std::uint32_t id, CSkillInfo*& output) { // FUNCTION: fn_08269 bool CPlayerSkillBundle::UpdatePending(const CSkillInfo& value) { for (CSkillInfo& entry : this->pending) { - if (entry.id == value.id) { + if (value.id == entry.id) { entry.level = value.level; entry.id = value.id; entry.unknown_0014 = value.unknown_0014; @@ -155,7 +155,7 @@ CSkillInfo CPlayerSkillBundle::Pending(std::uint32_t id) { // FUNCTION: fn_08277 CSkillInfo* CPlayerSkillBundle::FindExtra(std::uint32_t id) { const auto entry = std::find_if(this->extra.begin(), this->extra.end(), - [id](const CSkillInfo& value) { return value.id == id; }); + [id](const CSkillInfo& value) { return id == value.id; }); return entry != this->extra.end() ? &*entry : nullptr; } diff --git a/Source/Render/DX9/DeviceStateDX9.cpp b/Source/Render/DX9/DeviceStateDX9.cpp index 9fed4d2ea..89c0d7598 100644 --- a/Source/Render/DX9/DeviceStateDX9.cpp +++ b/Source/Render/DX9/DeviceStateDX9.cpp @@ -65,7 +65,7 @@ HRESULT DeviceStateDX9::SetFVF(DWORD value) { return noDevice; } - if (this->fvf == value) { + if (value == this->fvf) { return D3D_OK; } diff --git a/Source/UI/Buttons/UITextButton.cpp b/Source/UI/Buttons/UITextButton.cpp index 93955de3a..27b759a7c 100644 --- a/Source/UI/Buttons/UITextButton.cpp +++ b/Source/UI/Buttons/UITextButton.cpp @@ -752,7 +752,7 @@ void UITabControl::RecalculateWidths() { void UIChatHisBox::Resize(int width, int height, bool flag) { const int oldWidth = this->geometry.width; this->Resize(width, height); - if (this->geometry.width != oldWidth && flag) { + if (oldWidth != this->geometry.width && flag) { this->sub_89C080(); } } diff --git a/Source/UI/GameSettings/GameSettingsUI.cpp b/Source/UI/GameSettings/GameSettingsUI.cpp index e6c835ef4..34c18fa50 100644 --- a/Source/UI/GameSettings/GameSettingsUI.cpp +++ b/Source/UI/GameSettings/GameSettingsUI.cpp @@ -1763,7 +1763,7 @@ void CUIGroupSkin::Refresh() { const int index = g_skinInfo.selected + 1; list->scrollBar->SetPosition(list->rowHeight * index); for (CUIComboItem* item : list->items) { - if (item->index == index) { + if (index == item->index) { list->SelectItem(item); return; } diff --git a/Source/UI/MiniPartyPlacement.cpp b/Source/UI/MiniPartyPlacement.cpp index 46b54d2d5..fb55f8f94 100644 --- a/Source/UI/MiniPartyPlacement.cpp +++ b/Source/UI/MiniPartyPlacement.cpp @@ -32,7 +32,7 @@ void __stdcall Nullsub228() { // FUNCTION: fn_17165 UIWindow* UIWindowMgr::FindSnapExcludedWindow(int cell) { for (UIWindow* window : this->snapExcluded) { - if (*reinterpret_cast(reinterpret_cast(window) + 0x104) == cell) { + if (cell == *reinterpret_cast(reinterpret_cast(window) + 0x104)) { return window; } } diff --git a/Source/UI/Rodex/UIRodexInboxWnd.cpp b/Source/UI/Rodex/UIRodexInboxWnd.cpp index 6569cea53..c33dba21f 100644 --- a/Source/UI/Rodex/UIRodexInboxWnd.cpp +++ b/Source/UI/Rodex/UIRodexInboxWnd.cpp @@ -659,7 +659,7 @@ void UIRodexInboxWnd::RefreshMailLists() { // FUNCTION: fn_10062 void UIRodexInboxWnd::RemoveInboxMail(int id) { for (std::vector::iterator it = this->mails0.begin(); it != this->mails0.end(); ++it) { - if (it->second == id) { + if (id == it->second) { this->mails0.erase(it); return; } diff --git a/Source/UI/UIMacroUserInfoWnd.cpp b/Source/UI/UIMacroUserInfoWnd.cpp index 62f29defa..c40b09dfc 100644 --- a/Source/UI/UIMacroUserInfoWnd.cpp +++ b/Source/UI/UIMacroUserInfoWnd.cpp @@ -256,7 +256,7 @@ void UIMacroReporterWnd::Slot25(int x, int y) { // OFFSET: 0x007F11F0 // FUNCTION: fn_09851 void UIMacroReporterWnd::Slot31(int, int) { - if (g_windowMgr.Capture() != this) { + if (this != g_windowMgr.Capture()) { return; } diff --git a/Source/UI/Window/FrameFocus.cpp b/Source/UI/Window/FrameFocus.cpp index f54748188..60d8d5ce5 100644 --- a/Source/UI/Window/FrameFocus.cpp +++ b/Source/UI/Window/FrameFocus.cpp @@ -48,7 +48,7 @@ void UIWindowMgr::RemoveOrder(int id) { } for (auto entry = this->windowHistory.begin(); entry != this->windowHistory.end(); ++entry) { - if (*entry == id) { + if (id == *entry) { this->windowHistory.erase(entry); return; } diff --git a/Source/UI/Window/UIWindow.cpp b/Source/UI/Window/UIWindow.cpp index 6d5a6a328..065cba3af 100644 --- a/Source/UI/Window/UIWindow.cpp +++ b/Source/UI/Window/UIWindow.cpp @@ -710,7 +710,7 @@ void UIWindow::PlaceBeside(UIWindow* anchor) { // OFFSET: 0x00A81A30 // FUNCTION: fn_16979 UIWindow* UIWindow::FindUid(std::uint32_t uid) { - if (this->m_uid == uid) { + if (uid == this->m_uid) { return this; }