mirror of https://github.com/OpenRCT2/OpenRCT2.git
Use DukValue for scripted entity id_get
This commit is contained in:
parent
512348a81d
commit
cd261fc7b2
|
@ -38,10 +38,15 @@ namespace OpenRCT2::Scripting
|
|||
}
|
||||
|
||||
private:
|
||||
int32_t id_get() const
|
||||
DukValue id_get() const
|
||||
{
|
||||
auto ctx = GetContext()->GetScriptEngine().GetContext();
|
||||
|
||||
auto entity = GetEntity();
|
||||
return entity != nullptr ? entity->sprite_index.ToUnderlying() : EntityId::GetNull().ToUnderlying();
|
||||
if (entity == nullptr)
|
||||
return ToDuk(ctx, nullptr);
|
||||
|
||||
return ToDuk(ctx, entity->sprite_index.ToUnderlying());
|
||||
}
|
||||
|
||||
std::string type_get() const
|
||||
|
|
Loading…
Reference in New Issue