1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-20 13:33:02 +01:00

Implement getter for "guest" and "staff" types in getAllEntities

This commit is contained in:
ZehMatt
2021-08-04 17:53:07 +03:00
parent 654fb83d3c
commit 78cff6e293

View File

@@ -147,6 +147,20 @@ namespace OpenRCT2::Scripting
result.push_back(GetObjectAsDukValue(_context, std::make_shared<ScStaff>(sprite->sprite_index)));
}
}
else if (type == "guest")
{
for (auto sprite : EntityList<Guest>())
{
result.push_back(GetObjectAsDukValue(_context, std::make_shared<ScGuest>(sprite->sprite_index)));
}
}
else if (type == "staff")
{
for (auto sprite : EntityList<Staff>())
{
result.push_back(GetObjectAsDukValue(_context, std::make_shared<ScStaff>(sprite->sprite_index)));
}
}
else
{
duk_error(_context, DUK_ERR_ERROR, "Invalid entity type.");