From 86002c2f181fcb26d2c635e664727fa97548713f Mon Sep 17 00:00:00 2001 From: notmatthewbeshay <92357869+NotMachow@users.noreply.github.com> Date: Wed, 11 Mar 2026 02:57:08 +1100 Subject: [PATCH] Use standard counts in DLC packs --- Minecraft.Client/Platform/Common/DLC/DLCPack.cpp | 14 +++++++------- Minecraft.Client/Platform/Common/DLC/DLCPack.h | 12 ++++++------ .../Platform/Common/XUI/XUI_SkinSelect.cpp | 6 +++--- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Minecraft.Client/Platform/Common/DLC/DLCPack.cpp b/Minecraft.Client/Platform/Common/DLC/DLCPack.cpp index 214ab96d1..ba555534b 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCPack.cpp +++ b/Minecraft.Client/Platform/Common/DLC/DLCPack.cpp @@ -278,7 +278,7 @@ bool DLCPack::doesPackContainFile(DLCManager::EDLCType type, const std::wstring return hasFile; } -DLCFile *DLCPack::getFile(DLCManager::EDLCType type, DWORD index) +DLCFile *DLCPack::getFile(DLCManager::EDLCType type, unsigned int index) { DLCFile *file = NULL; if(type == DLCManager::e_DLCType_All) @@ -333,9 +333,9 @@ DLCFile *DLCPack::getFile(DLCManager::EDLCType type, const std::wstring &path) return file; } -DWORD DLCPack::getDLCItemsCount(DLCManager::EDLCType type /*= DLCManager::e_DLCType_All*/) +unsigned int DLCPack::getDLCItemsCount(DLCManager::EDLCType type /*= DLCManager::e_DLCType_All*/) { - DWORD count = 0; + unsigned int count = 0; switch(type) { @@ -346,13 +346,13 @@ DWORD DLCPack::getDLCItemsCount(DLCManager::EDLCType type /*= DLCManager::e_DLCT } break; default: - count = (DWORD)m_files[(int)type].size(); + count = static_cast(m_files[(int)type].size()); break; }; return count; }; -DWORD DLCPack::getFileIndexAt(DLCManager::EDLCType type, const std::wstring &path, bool &found) +unsigned int DLCPack::getFileIndexAt(DLCManager::EDLCType type, const std::wstring &path, bool &found) { if(type == DLCManager::e_DLCType_All) { @@ -363,9 +363,9 @@ DWORD DLCPack::getFileIndexAt(DLCManager::EDLCType type, const std::wstring &pat return 0; } - DWORD foundIndex = 0; + unsigned int foundIndex = 0; found = false; - DWORD index = 0; + unsigned int index = 0; for(AUTO_VAR(it, m_files[type].begin()); it != m_files[type].end(); ++it) { if(path.compare((*it)->getPath()) == 0) diff --git a/Minecraft.Client/Platform/Common/DLC/DLCPack.h b/Minecraft.Client/Platform/Common/DLC/DLCPack.h index 692fca722..7777ed4d3 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCPack.h +++ b/Minecraft.Client/Platform/Common/DLC/DLCPack.h @@ -76,18 +76,18 @@ public: #endif DLCFile *addFile(DLCManager::EDLCType type, const std::wstring &path); - DLCFile *getFile(DLCManager::EDLCType type, DWORD index); + DLCFile *getFile(DLCManager::EDLCType type, unsigned int index); DLCFile *getFile(DLCManager::EDLCType type, const std::wstring &path); - DWORD getDLCItemsCount(DLCManager::EDLCType type = DLCManager::e_DLCType_All); - DWORD getFileIndexAt(DLCManager::EDLCType type, const std::wstring &path, bool &found); + unsigned int getDLCItemsCount(DLCManager::EDLCType type = DLCManager::e_DLCType_All); + unsigned int getFileIndexAt(DLCManager::EDLCType type, const std::wstring &path, bool &found); bool doesPackContainFile(DLCManager::EDLCType type, const std::wstring &path); std::uint32_t GetPackID() {return m_packId;} - DWORD getSkinCount() { return getDLCItemsCount(DLCManager::e_DLCType_Skin); } - DWORD getSkinIndexAt(const std::wstring &path, bool &found) { return getFileIndexAt(DLCManager::e_DLCType_Skin, path, found); } + unsigned int getSkinCount() { return getDLCItemsCount(DLCManager::e_DLCType_Skin); } + unsigned int getSkinIndexAt(const std::wstring &path, bool &found) { return getFileIndexAt(DLCManager::e_DLCType_Skin, path, found); } DLCSkinFile *getSkinFile(const std::wstring &path) { return (DLCSkinFile *)getFile(DLCManager::e_DLCType_Skin, path); } - DLCSkinFile *getSkinFile(DWORD index) { return (DLCSkinFile *)getFile(DLCManager::e_DLCType_Skin, index); } + DLCSkinFile *getSkinFile(unsigned int index) { return (DLCSkinFile *)getFile(DLCManager::e_DLCType_Skin, index); } bool doesPackContainSkin(const std::wstring &path) { return doesPackContainFile(DLCManager::e_DLCType_Skin, path); } bool hasPurchasedFile(DLCManager::EDLCType type, const std::wstring &path); diff --git a/Minecraft.Client/Platform/Common/XUI/XUI_SkinSelect.cpp b/Minecraft.Client/Platform/Common/XUI/XUI_SkinSelect.cpp index 71f9c9336..189b3bb89 100644 --- a/Minecraft.Client/Platform/Common/XUI/XUI_SkinSelect.cpp +++ b/Minecraft.Client/Platform/Common/XUI/XUI_SkinSelect.cpp @@ -1007,7 +1007,7 @@ void CScene_SkinSelect::handlePackIndexChanged() if(m_currentPack != NULL) { bool found; - DWORD currentSkinIndex = m_currentPack->getSkinIndexAt(m_currentSkinPath, found); + unsigned int currentSkinIndex = m_currentPack->getSkinIndexAt(m_currentSkinPath, found); if(found) m_skinIndex = currentSkinIndex; } else @@ -1036,7 +1036,7 @@ void CScene_SkinSelect::handlePackIndexChanged() DLCPack *Pack=app.m_dlcManager.getPackContainingSkin(chars); if(Pack) { - DWORD currentSkinIndex = Pack->getSkinIndexAt(m_currentSkinPath, found); + unsigned int currentSkinIndex = Pack->getSkinIndexAt(m_currentSkinPath, found); if(found) m_skinIndex = app.GetPlayerFavoriteSkinsPos(m_iPad); } } @@ -1441,4 +1441,4 @@ void CScene_SkinSelect::AddFavoriteSkin(int iPad,int iSkinID) app.SetPlayerFavoriteSkin(iPad,(int)ucPos,iSkinID); app.SetPlayerFavoriteSkinsPos(m_iPad,ucPos); -} \ No newline at end of file +}