1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-29 09:44:52 +01:00

Change track segment API to use null

This commit is contained in:
Ted John
2022-05-17 19:33:04 +01:00
parent 7af322f8eb
commit 31764f62c6
3 changed files with 9 additions and 9 deletions

View File

@@ -224,7 +224,7 @@ namespace OpenRCT2::Scripting
auto ctx = GetContext()->GetScriptEngine().GetContext();
if (type >= TrackElemType::Count)
{
return ToDuk(ctx, undefined);
return ToDuk(ctx, nullptr);
}
else
{

View File

@@ -61,7 +61,7 @@ DukValue ScTrackIterator::segment_get() const
auto ctx = scriptEngine.GetContext();
if (_type >= TrackElemType::Count)
return ToDuk(ctx, undefined);
return ToDuk(ctx, nullptr);
return GetObjectAsDukValue(ctx, std::make_shared<ScTrackSegment>(_type));
}
@@ -77,7 +77,7 @@ DukValue ScTrackIterator::previousPosition_get() const
auto el = map_get_track_element_at_of_type_seq(pos, _type, 0);
if (el == nullptr)
return ToDuk(ctx, undefined);
return ToDuk(ctx, nullptr);
auto posEl = CoordsXYE(pos.x, pos.y, reinterpret_cast<TileElement*>(el));
track_begin_end tbe{};
@@ -97,7 +97,7 @@ DukValue ScTrackIterator::nextPosition_get() const
auto el = map_get_track_element_at_of_type_seq(pos, _type, 0);
if (el == nullptr)
return ToDuk(ctx, undefined);
return ToDuk(ctx, nullptr);
auto posEl = CoordsXYE(_position.x, _position.y, reinterpret_cast<TileElement*>(el));
CoordsXYE next;