diff --git a/Source/Client/Mode/GameModeNotices.cpp b/Source/Client/Mode/GameModeNotices.cpp index f247de49..a14200fe 100644 --- a/Source/Client/Mode/GameModeNotices.cpp +++ b/Source/Client/Mode/GameModeNotices.cpp @@ -1122,7 +1122,7 @@ struct ActorEffect228Packet { void CGameMode::ReceiveGradeEnchantInfo(const unsigned char* data) { const auto* packet = reinterpret_cast(data); const int count = static_cast(packet->length - sizeof(GradeEnchantInfoPacket)) / sizeof(GradeEnchantMaterial); - if (packet->index == -1) { + if (-1 == packet->index) { g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3720)), 0x62B0FF, 0, 0, 0); return; } @@ -1636,7 +1636,7 @@ void CGameMode::ReceiveLapineUpgradeResult(std::int16_t result) { // OFFSET: 0x00D6B070 // FUNCTION: fn_22067 void CGameMode::ReceiveLapineBoxResult(std::uint16_t result) { - if (result != 0) { + if (0 != result) { UIWindow* window = g_windowMgr.LookupWindow(290); if (window) { static_cast(window)->SetWaiting(0); diff --git a/Source/Client/Mode/GameModePackets.cpp b/Source/Client/Mode/GameModePackets.cpp index f5948006..7c6feb50 100644 --- a/Source/Client/Mode/GameModePackets.cpp +++ b/Source/Client/Mode/GameModePackets.cpp @@ -1458,7 +1458,7 @@ __declspec(noinline) void CGameMode::ReceiveMemorialDungeonNotify(const unsigned const int previous = g_session.unknown_5948; g_session.unknown_5970 = *reinterpret_cast(packet + 6); const int time = *reinterpret_cast(packet + 6); - g_session.unknown_5948 = time != 0 ? 1 : 2; + g_session.unknown_5948 = 0 != time ? 1 : 2; if (*reinterpret_cast(packet + 2) == 0) { if (previous != (time != 0 ? 1 : 2) || time != 0 || g_session.unknown_593C != 0) { if (UIWindow* window = g_windowMgr.EnsureWindow(137)) { diff --git a/Source/Client/ReplayControl.cpp b/Source/Client/ReplayControl.cpp index aaf32728..6465990f 100644 --- a/Source/Client/ReplayControl.cpp +++ b/Source/Client/ReplayControl.cpp @@ -3,25 +3,25 @@ // OFFSET: 0x00B844C0 // FUNCTION: fn_19316 float Replay::AnimationScale() const { - if (this->speed == 0.25f) { + if (0.25f == this->speed) { return 1.4f; } - if (this->speed == 0.5f) { + if (0.5f == this->speed) { return 1.2f; } - if (this->speed == 1.0f) { + if (1.0f == this->speed) { return 1.0f; } - if (this->speed == 2.0f) { + if (2.0f == this->speed) { return 0.8f; } - if (this->speed == 4.0f) { + if (4.0f == this->speed) { return 0.6f; } - if (this->speed == 8.0f) { + if (8.0f == this->speed) { return 0.4f; } - if (this->speed == 16.0f) { + if (16.0f == this->speed) { return 0.2f; } return 1.0f; diff --git a/Source/Contents/ActorMovementRoute.cpp b/Source/Contents/ActorMovementRoute.cpp index f6b223b3..e606a4e9 100644 --- a/Source/Contents/ActorMovementRoute.cpp +++ b/Source/Contents/ActorMovementRoute.cpp @@ -9,25 +9,25 @@ CPathFinder g_pathFinder; // OFFSET: 0x00B84570 // FUNCTION: fn_19317 float Replay::DelayScale() const { - if (this->speed == 0.25f) { + if (0.25f == this->speed) { return 4.0f; } - if (this->speed == 0.5f) { + if (0.5f == this->speed) { return 2.0f; } - if (this->speed == 1.0f) { + if (1.0f == this->speed) { return 1.0f; } - if (this->speed == 2.0f) { + if (2.0f == this->speed) { return 0.5f; } - if (this->speed == 4.0f) { + if (4.0f == this->speed) { return 0.25f; } - if (this->speed == 8.0f) { + if (8.0f == this->speed) { return 0.125f; } - if (this->speed == 16.0f) { + if (16.0f == this->speed) { return 0.0625f; } return 1.0f; diff --git a/Source/Contents/Items/NeoPackageItemMgr.cpp b/Source/Contents/Items/NeoPackageItemMgr.cpp index 476e8dc1..d3b1a615 100644 --- a/Source/Contents/Items/NeoPackageItemMgr.cpp +++ b/Source/Contents/Items/NeoPackageItemMgr.cpp @@ -241,7 +241,7 @@ bool CPaidPackageItemMgr::LoadScript() { // OFFSET: 0x006D3370 // FUNCTION: fn_06538 bool CPaidPackageItemMgr::IsPaidItem(int itemId) { - if (this->m_items.find(itemId) != this->m_items.end() && CNeoPackageItemMgr::GetInstance()->HasPackage(itemId)) { + if (this->m_items.end() != this->m_items.find(itemId) && CNeoPackageItemMgr::GetInstance()->HasPackage(itemId)) { return true; } diff --git a/Source/Contents/Items/RuneSystem.cpp b/Source/Contents/Items/RuneSystem.cpp index 95249b94..6db847da 100644 --- a/Source/Contents/Items/RuneSystem.cpp +++ b/Source/Contents/Items/RuneSystem.cpp @@ -566,7 +566,7 @@ void CRuneSystemMgr::Reset() { CTagData* tag = *tagIt; tag->m_locked = false; for (int type = 0; type < 2; ++type) { - for (std::vector::iterator runeIt = tag->m_runes[type].begin(); runeIt != tag->m_runes[type].end(); ++runeIt) { + for (std::vector::iterator runeIt = tag->m_runes[type].begin(); tag->m_runes[type].end() != runeIt; ++runeIt) { if (*runeIt) { (*runeIt)->m_active = false; if (type == 0) { diff --git a/Source/Contents/NavigationRoute.cpp b/Source/Contents/NavigationRoute.cpp index 1f1da58e..f2cb4880 100644 --- a/Source/Contents/NavigationRoute.cpp +++ b/Source/Contents/NavigationRoute.cpp @@ -889,8 +889,8 @@ float CNavigationManager::FitToSquare(int* offsetX, int* offsetY, int width, int *offsetX = static_cast((height - width) * 0.5f * scale); *offsetY = 0; } else { - *offsetY = 0; scale = size / width; + *offsetY = 0; *offsetX = 0; } return scale; diff --git a/Source/Contents/PetEvolutionMgr.cpp b/Source/Contents/PetEvolutionMgr.cpp index 53b42e2d..404db66f 100644 --- a/Source/Contents/PetEvolutionMgr.cpp +++ b/Source/Contents/PetEvolutionMgr.cpp @@ -194,7 +194,7 @@ int CPetEvolutionMgr::L_InsertEvolutionRecipeLGU(lua_State* state) { } else if (!g_session.IsPetEgg(target)) { lua_pushboolean(state, 0); lua_pushstring(state, FormatString("Revolutuion PetEgg Item %d not found or not petegg", target)); - } else if (count < 1) { + } else if (count <= 0) { lua_pushboolean(state, 0); lua_pushstring(state, FormatString("Material Item Cnt %d Error", count)); } else { diff --git a/Source/Contents/RenewQuestMgr.cpp b/Source/Contents/RenewQuestMgr.cpp index aa79627e..c0453db9 100644 --- a/Source/Contents/RenewQuestMgr.cpp +++ b/Source/Contents/RenewQuestMgr.cpp @@ -321,7 +321,7 @@ std::string CRenewQuestMgr::GetMonsterConditionText(unsigned int flags, int minL } else if (minLevel > 0) { if (maxLevel == 0) { result = result + " Lv." + IntToString(minLevel, 0) + "▲"; - } else if (maxLevel > minLevel) { + } else if (minLevel < maxLevel) { result = result + " Lv." + IntToString(minLevel, 0) + "~Lv." + IntToString(maxLevel, 0); } }