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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user