1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-29 17:54:50 +01:00

Protect against Sources being null

This commit is contained in:
Gymnasiast
2018-07-30 22:01:04 +02:00
parent 8ff6831c57
commit edaebd5163
4 changed files with 11 additions and 3 deletions

View File

@@ -49,6 +49,14 @@ struct ObjectRepositoryItem
{
std::vector<rct_object_entry> Entries;
} SceneryGroupInfo;
OBJECT_SOURCE_GAME GetFirstSourceGame() const
{
if (Sources.empty())
return OBJECT_SOURCE_CUSTOM;
else
return (OBJECT_SOURCE_GAME)Sources[0];
}
};
interface IObjectRepository