Small cleanup in ScMap.hpp

This commit is contained in:
ZehMatt 2021-08-02 02:40:05 +03:00
parent e3c918ba5b
commit c1d97b845e
No known key found for this signature in database
GPG Key ID: 18CE582C71A225B0
1 changed files with 2 additions and 8 deletions

View File

@ -38,13 +38,7 @@ namespace OpenRCT2::Scripting
DukValue size_get() const DukValue size_get() const
{ {
auto ctx = _context; return ToDuk(_context, CoordsXY{ gMapSize, gMapSize });
auto objIdx = duk_push_object(ctx);
duk_push_number(ctx, gMapSize);
duk_put_prop_string(ctx, objIdx, "x");
duk_push_number(ctx, gMapSize);
duk_put_prop_string(ctx, objIdx, "y");
return DukValue::take_from_stack(ctx);
} }
int32_t numRides_get() const int32_t numRides_get() const
@ -110,7 +104,7 @@ namespace OpenRCT2::Scripting
result.push_back(GetObjectAsDukValue(_context, std::make_shared<ScEntity>(sprite->sprite_index))); result.push_back(GetObjectAsDukValue(_context, std::make_shared<ScEntity>(sprite->sprite_index)));
} }
} }
if (type == "car") else if (type == "car")
{ {
for (auto trainHead : TrainManager::View()) for (auto trainHead : TrainManager::View())
{ {