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