forked from rosebudai/OpenRCT2-Web
1 parent
41b1cd01bc
commit
e87de05792
2 files changed
+9
-2
No files matched your search
@@ -1,5 +1,6 @@
|
||||
0.5.7 (in development)
|
||||
------------------------------------------------------------------------
|
||||
- Fix: [#16807] Error messages when trying to load regular JSON files as custom objects.
|
||||
- Fix: [#24524] Some build types (like AppImage) lack information about their specific build.
|
||||
- Fix: [#27264] Headless server crashes when loading a recolourable terrain surface.
|
||||
|
||||
|
||||
@@ -529,9 +529,15 @@ namespace OpenRCT2::ObjectFactory
|
||||
std::unique_ptr<Object> CreateObjectFromJson(
|
||||
json_t& jRoot, const IFileDataRetriever* fileRetriever, bool loadImageTable, const std::string_view path)
|
||||
{
|
||||
if (!jRoot.is_object())
|
||||
if (!jRoot.is_object() || !jRoot.contains("objectType"))
|
||||
{
|
||||
throw std::runtime_error("Object JSON root was not an object");
|
||||
LOG_VERBOSE("Ignoring JSON file (%.*s): not an object file", static_cast<int>(path.length()), path.data());
|
||||
return nullptr;
|
||||
}
|
||||
if (!jRoot["objectType"].is_string())
|
||||
{
|
||||
LOG_VERBOSE("Ignoring JSON file (%.*s): objectType is not a string", static_cast<int>(path.length()), path.data());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
LOG_VERBOSE("CreateObjectFromJson(...)");
|
||||
|
||||
Reference in new issue
Block a user