1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-23 15:52:55 +01:00

Return null pointer if an override is not specified, rather than an empty string

This commit is contained in:
Michael Steenbeek
2017-12-15 12:43:50 +01:00
parent 65fc7f914f
commit 2a509c2c02

View File

@@ -157,7 +157,7 @@ public:
sint32 ooIndex = offset / ScenarioOverrideMaxStringCount;
sint32 ooStringIndex = offset % ScenarioOverrideMaxStringCount;
if (_scenarioOverrides.size() > (size_t)ooIndex)
if ((_scenarioOverrides.size() > (size_t)ooIndex) && !String::Equals(_scenarioOverrides[ooIndex].strings[ooStringIndex].c_str(), ""))
{
return _scenarioOverrides[ooIndex].strings[ooStringIndex].c_str();
}
@@ -172,7 +172,7 @@ public:
sint32 ooIndex = offset / ObjectOverrideMaxStringCount;
sint32 ooStringIndex = offset % ObjectOverrideMaxStringCount;
if (_objectOverrides.size() > (size_t)ooIndex)
if ((_objectOverrides.size() > (size_t)ooIndex) && !String::Equals(_objectOverrides[ooIndex].strings[ooStringIndex].c_str(), ""))
{
return _objectOverrides[ooIndex].strings[ooStringIndex].c_str();
}