Use standard wide string returns in game rules

This commit is contained in:
notmatthewbeshay 2026-03-11 01:03:47 +11:00
parent dd726f8ba1
commit 09896918cd
8 changed files with 9 additions and 9 deletions

View file

@ -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);
}

View file

@ -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

View file

@ -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() )
{

View file

@ -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.

View file

@ -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)
{

View file

@ -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<std::wstring, ConsoleSchematicFile *> *getUnfinishedSchematicFiles();

View file

@ -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)
{

View file

@ -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; }
};
};