1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-17 12:03:07 +01:00

add object property validation

This commit is contained in:
Ted John
2016-07-02 17:23:06 +01:00
parent 7e1f948e19
commit 2cade7dd13
7 changed files with 68 additions and 0 deletions

View File

@@ -80,6 +80,20 @@ void RideObject::ReadLegacy(IReadObjectContext * context, IStream * stream)
}
GetImageTable()->Read(context, stream);
// Validate properties
if (_legacyType.excitement_multipler > 75)
{
context->LogError(OBJECT_ERROR_INVALID_PROPERTY, "Excitement multiplier too high.");
}
if (_legacyType.intensity_multipler > 75)
{
context->LogError(OBJECT_ERROR_INVALID_PROPERTY, "Intensity multiplier too high.");
}
if (_legacyType.nausea_multipler > 75)
{
context->LogError(OBJECT_ERROR_INVALID_PROPERTY, "Nausea multiplier too high.");
}
}
void RideObject::Load()