diff --git a/Source/Contents/EquipmentResources.cpp b/Source/Contents/EquipmentResources.cpp index e919b79b8..35c0c3eb0 100644 --- a/Source/Contents/EquipmentResources.cpp +++ b/Source/Contents/EquipmentResources.cpp @@ -194,7 +194,7 @@ std::string CSession::GetShieldSprName(int job, int sex, int shield, int costume // OFFSET: 0x00E0A2C0 // FUNCTION: fn_23794 std::string CSession::GetAccessoryName(int id) { - if (id < 0 || static_cast(id) >= this->m_accessoryNames.size()) { + if (id < 0 || this->m_accessoryNames.size() <= id) { return "_병아리모자"; } return this->m_accessoryNames[id]; diff --git a/Source/Contents/Items/ItemNaming.cpp b/Source/Contents/Items/ItemNaming.cpp index 467e78343..ddbcd97b1 100644 --- a/Source/Contents/Items/ItemNaming.cpp +++ b/Source/Contents/Items/ItemNaming.cpp @@ -93,26 +93,25 @@ bool ITEM_INFO::HasCards() const { // FUNCTION: fn_06577 __declspec(noinline) int ITEM_INFO::Grade(char* output, int& capacity, unsigned char consume) const { char grade[2] = {}; - if (this->grade == 1) { + if (1 == this->grade) { grade[0] = 'D'; - } else if (this->grade == 2) { + } else if (2 == this->grade) { grade[0] = 'C'; - } else if (this->grade == 3) { + } else if (3 == this->grade) { grade[0] = 'B'; - } else if (this->grade == 4) { + } else if (4 == this->grade) { grade[0] = 'A'; } const int bytes = StringFormat(output, capacity, _TRUNCATE, "[%s] ", grade); - if (bytes <= 0) { - return 0; + if (bytes > 0) { + if (consume) { + capacity -= bytes; + } + return bytes; } - if (consume) { - capacity -= bytes; - } - - return bytes; + return 0; } // OFFSET: 0x006D6C10 diff --git a/Source/Contents/Items/RuneSystem.cpp b/Source/Contents/Items/RuneSystem.cpp index b02a32005..43b2fcc07 100644 --- a/Source/Contents/Items/RuneSystem.cpp +++ b/Source/Contents/Items/RuneSystem.cpp @@ -214,7 +214,7 @@ CTagData* CRuneSystemMgr::GetTag(int tagId) { // OFFSET: 0x00766B60 // FUNCTION: fn_08121 CTagData* CRuneSystemMgr::GetTagByIndex(int index) { - if (index < 0 || static_cast(index) >= this->m_tags.size()) { + if (index < 0 || this->m_tags.size() <= index) { return nullptr; } diff --git a/Source/Contents/Items/SelectPackageItemMgr.cpp b/Source/Contents/Items/SelectPackageItemMgr.cpp index db7178f90..c8dd8bd7e 100644 --- a/Source/Contents/Items/SelectPackageItemMgr.cpp +++ b/Source/Contents/Items/SelectPackageItemMgr.cpp @@ -24,7 +24,7 @@ CSelectPackageItemMgr::CSelectPackageItemMgr() { // OFFSET: 0x0061EC30 // FUNCTION: fn_04445 void CSelectPackageItemMgr::AddTab(int packageId, int tabIndex, const std::string& name, int itemCount) { - if (this->m_packages.find(packageId) == this->m_packages.end()) { + if (this->m_packages.end() == this->m_packages.find(packageId)) { this->m_packages[packageId] = std::map(); } diff --git a/Source/Contents/Skills/ClientSkills.cpp b/Source/Contents/Skills/ClientSkills.cpp index d99114f02..58e0f6daf 100644 --- a/Source/Contents/Skills/ClientSkills.cpp +++ b/Source/Contents/Skills/ClientSkills.cpp @@ -493,12 +493,12 @@ void CSession::ClearUnknown0420() { // FUNCTION: fn_23760 void CSession::EraseUnknownKey(std::int64_t key) { auto first = this->summonHp.find(key); - if (first != this->summonHp.end()) { + if (this->summonHp.end() != first) { this->summonHp.erase(first); } auto second = this->summonMaxHp.find(key); - if (second != this->summonMaxHp.end()) { + if (this->summonMaxHp.end() != second) { this->summonMaxHp.erase(second); } } diff --git a/Source/Render/DX9/TextureDX9.cpp b/Source/Render/DX9/TextureDX9.cpp index 1cc06a74d..30848ec60 100644 --- a/Source/Render/DX9/TextureDX9.cpp +++ b/Source/Render/DX9/TextureDX9.cpp @@ -91,7 +91,7 @@ CTextureDX9::CTextureDX9(DeviceOwnerDX9& owner, IDirect3DTexture9* texture) : CT } this->m_format = format; - this->m_width = this->m_height = this->m_description.Width; + this->m_height = this->m_width = this->m_description.Width; } }