From 09896918cd0707294f12c06120c5fa34ea556023 Mon Sep 17 00:00:00 2001 From: notmatthewbeshay <92357869+NotMachow@users.noreply.github.com> Date: Wed, 11 Mar 2026 01:03:47 +1100 Subject: [PATCH] Use standard wide string returns in game rules --- Minecraft.Client/Platform/Common/Consoles_App.cpp | 2 +- Minecraft.Client/Platform/Common/Consoles_App.h | 2 +- .../Platform/Common/GameRules/GameRuleManager.cpp | 2 +- Minecraft.Client/Platform/Common/GameRules/GameRuleManager.h | 2 +- .../Platform/Common/GameRules/LevelGenerationOptions.cpp | 2 +- .../Platform/Common/GameRules/LevelGenerationOptions.h | 2 +- Minecraft.Client/Platform/Common/GameRules/LevelRuleset.cpp | 2 +- Minecraft.Client/Platform/Common/GameRules/LevelRuleset.h | 4 ++-- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Minecraft.Client/Platform/Common/Consoles_App.cpp b/Minecraft.Client/Platform/Common/Consoles_App.cpp index 90f309b0c..f5af72578 100644 --- a/Minecraft.Client/Platform/Common/Consoles_App.cpp +++ b/Minecraft.Client/Platform/Common/Consoles_App.cpp @@ -7605,7 +7605,7 @@ void CMinecraftApp::setLevelGenerationOptions(LevelGenerationOptions *levelGen) m_gameRules.setLevelGenerationOptions(levelGen); } -LPCWSTR CMinecraftApp::GetGameRulesString(const std::wstring &key) +const wchar_t *CMinecraftApp::GetGameRulesString(const std::wstring &key) { return m_gameRules.GetGameRulesString(key); } diff --git a/Minecraft.Client/Platform/Common/Consoles_App.h b/Minecraft.Client/Platform/Common/Consoles_App.h index 5233e8b6a..395854a14 100644 --- a/Minecraft.Client/Platform/Common/Consoles_App.h +++ b/Minecraft.Client/Platform/Common/Consoles_App.h @@ -719,7 +719,7 @@ public: void setLevelGenerationOptions(LevelGenerationOptions *levelGen); LevelRuleset *getGameRuleDefinitions() { return m_gameRules.getGameRuleDefinitions(); } LevelGenerationOptions *getLevelGenerationOptions() { return m_gameRules.getLevelGenerationOptions(); } - LPCWSTR GetGameRulesString(const std::wstring &key); + const wchar_t *GetGameRulesString(const std::wstring &key); private: BYTE m_playerColours[MINECRAFT_NET_MAX_PLAYERS]; // An array of QNet small-id's diff --git a/Minecraft.Client/Platform/Common/GameRules/GameRuleManager.cpp b/Minecraft.Client/Platform/Common/GameRules/GameRuleManager.cpp index aaa5b40d3..3e0e077aa 100644 --- a/Minecraft.Client/Platform/Common/GameRules/GameRuleManager.cpp +++ b/Minecraft.Client/Platform/Common/GameRules/GameRuleManager.cpp @@ -749,7 +749,7 @@ void GameRuleManager::setLevelGenerationOptions(LevelGenerationOptions *levelGen m_currentLevelGenerationOptions->reset_start(); } -LPCWSTR GameRuleManager::GetGameRulesString(const std::wstring &key) +const wchar_t *GameRuleManager::GetGameRulesString(const std::wstring &key) { if(m_currentGameRuleDefinitions != NULL && !key.empty() ) { diff --git a/Minecraft.Client/Platform/Common/GameRules/GameRuleManager.h b/Minecraft.Client/Platform/Common/GameRules/GameRuleManager.h index 8d55510af..7bc3f2dfd 100644 --- a/Minecraft.Client/Platform/Common/GameRules/GameRuleManager.h +++ b/Minecraft.Client/Platform/Common/GameRules/GameRuleManager.h @@ -72,7 +72,7 @@ public: void setLevelGenerationOptions(LevelGenerationOptions *levelGen); LevelRuleset *getGameRuleDefinitions() { return m_currentGameRuleDefinitions; } LevelGenerationOptions *getLevelGenerationOptions() { return m_currentLevelGenerationOptions; } - LPCWSTR GetGameRulesString(const std::wstring &key); + const wchar_t *GetGameRulesString(const std::wstring &key); // 4J-JEV: // Properly cleans-up and unloads the current set of gameRules. diff --git a/Minecraft.Client/Platform/Common/GameRules/LevelGenerationOptions.cpp b/Minecraft.Client/Platform/Common/GameRules/LevelGenerationOptions.cpp index 39de339cb..2e2e6c904 100644 --- a/Minecraft.Client/Platform/Common/GameRules/LevelGenerationOptions.cpp +++ b/Minecraft.Client/Platform/Common/GameRules/LevelGenerationOptions.cpp @@ -388,7 +388,7 @@ void LevelGenerationOptions::loadStringTable(StringTable *table) m_stringTable = table; } -LPCWSTR LevelGenerationOptions::getString(const std::wstring &key) +const wchar_t *LevelGenerationOptions::getString(const std::wstring &key) { if(m_stringTable == NULL) { diff --git a/Minecraft.Client/Platform/Common/GameRules/LevelGenerationOptions.h b/Minecraft.Client/Platform/Common/GameRules/LevelGenerationOptions.h index 07597c139..829d03b4e 100644 --- a/Minecraft.Client/Platform/Common/GameRules/LevelGenerationOptions.h +++ b/Minecraft.Client/Platform/Common/GameRules/LevelGenerationOptions.h @@ -202,7 +202,7 @@ public: bool isFeatureChunk(int chunkX, int chunkZ, StructureFeature::EFeatureTypes feature); void loadStringTable(StringTable *table); - LPCWSTR getString(const std::wstring &key); + const wchar_t *getString(const std::wstring &key); std::unordered_map *getUnfinishedSchematicFiles(); diff --git a/Minecraft.Client/Platform/Common/GameRules/LevelRuleset.cpp b/Minecraft.Client/Platform/Common/GameRules/LevelRuleset.cpp index 7137e7ac7..0c0e2cb08 100644 --- a/Minecraft.Client/Platform/Common/GameRules/LevelRuleset.cpp +++ b/Minecraft.Client/Platform/Common/GameRules/LevelRuleset.cpp @@ -44,7 +44,7 @@ void LevelRuleset::loadStringTable(StringTable *table) m_stringTable = table; } -LPCWSTR LevelRuleset::getString(const std::wstring &key) +const wchar_t *LevelRuleset::getString(const std::wstring &key) { if(m_stringTable == NULL) { diff --git a/Minecraft.Client/Platform/Common/GameRules/LevelRuleset.h b/Minecraft.Client/Platform/Common/GameRules/LevelRuleset.h index 93802450c..1b7810659 100644 --- a/Minecraft.Client/Platform/Common/GameRules/LevelRuleset.h +++ b/Minecraft.Client/Platform/Common/GameRules/LevelRuleset.h @@ -19,9 +19,9 @@ public: virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_LevelRules; } void loadStringTable(StringTable *table); - LPCWSTR getString(const std::wstring &key); + const wchar_t *getString(const std::wstring &key); AABB *getNamedArea(const std::wstring &areaName); StringTable *getStringTable() { return m_stringTable; } -}; \ No newline at end of file +};