handle empty string tables

This commit is contained in:
Ted John committed 2016-07-08 22:58:38 +01:00
1 parent 1af6242381
commit a0d8b9ccbf
12 files changed
+76 -61

No files matched your search

+9 -6
View File
@@ -37,9 +37,9 @@ void StexObject::ReadLegacy(IStream * stream)
_legacyType.var_06 = stream->ReadValue<uint8>();
stream->Seek(1, STREAM_SEEK_CURRENT);
GetStringTable().Read(stream, OBJ_STRING_ID_SCENARIO_NAME);
GetStringTable().Read(stream, OBJ_STRING_ID_PARK_NAME);
GetStringTable().Read(stream, OBJ_STRING_ID_SCENARIO_DETAILS);
GetStringTable()->Read(stream, OBJ_STRING_ID_SCENARIO_NAME);
GetStringTable()->Read(stream, OBJ_STRING_ID_PARK_NAME);
GetStringTable()->Read(stream, OBJ_STRING_ID_SCENARIO_DETAILS);
}
void StexObject::Load()
@@ -63,15 +63,18 @@ const utf8 * StexObject::GetName()
const utf8 * StexObject::GetScenarioName()
{
return GetStringTable().GetString(OBJ_STRING_ID_SCENARIO_NAME);
const utf8 * name = GetStringTable()->GetString(OBJ_STRING_ID_SCENARIO_NAME);
return name != nullptr ? name : "";
}
const utf8 * StexObject::GetScenarioDetails()
{
return GetStringTable().GetString(OBJ_STRING_ID_SCENARIO_DETAILS);
const utf8 * name = GetStringTable()->GetString(OBJ_STRING_ID_SCENARIO_DETAILS);
return name != nullptr ? name : "";
}
const utf8 * StexObject::GetParkName()
{
return GetStringTable().GetString(OBJ_STRING_ID_PARK_NAME);
const utf8 * name = GetStringTable()->GetString(OBJ_STRING_ID_PARK_NAME);
return name != nullptr ? name : "";
}