1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-21 05:53:02 +01:00

check for LoadObjects failure

This commit is contained in:
Ted John
2016-07-09 14:13:46 +01:00
parent abda262b13
commit a25d7aa535

View File

@@ -207,6 +207,8 @@ public:
// TODO append checksum match bytes
// TODO check object is loadable before writing it
utf8 path[MAX_PATH];
GetPathForNewObject(path, sizeof(path), objectName);
@@ -540,11 +542,12 @@ private:
Path::Append(buffer, bufferSize, normalisedName);
String::Append(buffer, bufferSize, ".DAT");
uint32 counter = 2;
for (; platform_file_exists(buffer);)
{
uint32 counter = 2;
utf8 counterString[8];
snprintf(counterString, sizeof(counterString), "-%02X", counter);
counter++;
GetUserObjectPath(buffer, bufferSize);
Path::Append(buffer, bufferSize, normalisedName);
@@ -634,10 +637,10 @@ extern "C"
log_verbose("loading required objects");
IObjectManager * objectManger = GetObjectManager();
objectManger->LoadObjects(entries, OBJECT_ENTRY_COUNT);
bool result = objectManger->LoadObjects(entries, OBJECT_ENTRY_COUNT);
log_verbose("finished loading required objects");
return true;
return result;
}
void * object_repository_load_object(const rct_object_entry * objectEntry)