diff --git a/client/src/bindings/Interior.cpp b/client/src/bindings/Interior.cpp index 08c1f8b1..051b9fc4 100644 --- a/client/src/bindings/Interior.cpp +++ b/client/src/bindings/Interior.cpp @@ -138,6 +138,13 @@ static void GetPortalByIndex(const v8::FunctionCallbackInfo& info) V8_RETURN(v8InteriorPortal.New(isolate->GetEnteredOrMicrotaskContext(), args)); } +static void IdGetter(v8::Local, const v8::PropertyCallbackInfo& info) +{ + V8_GET_ISOLATE_CONTEXT(); + V8_GET_THIS_INTERNAL_FIELD_UINT32(1, interiorId); + V8_RETURN_UINT(interiorId); +} + extern V8Class v8Interior("Interior", Constructor, [](v8::Local tpl) @@ -155,6 +162,7 @@ extern V8Class v8Interior("Interior", V8Helpers::SetAccessor(isolate, tpl, "pos", &PositionGetter); V8Helpers::SetAccessor(isolate, tpl, "rot", &RotationGetter); V8Helpers::SetAccessor(isolate, tpl, "entitiesExtents", &EntitiesExtentsGetter); + V8Helpers::SetAccessor(isolate, tpl, "id", &IdGetter); V8Helpers::SetStaticMethod(isolate, tpl, "getForInteriorID", &GetForInteriorID); }); diff --git a/client/src/bindings/InteriorPortal.cpp b/client/src/bindings/InteriorPortal.cpp index 0bb929b5..58c62cbb 100644 --- a/client/src/bindings/InteriorPortal.cpp +++ b/client/src/bindings/InteriorPortal.cpp @@ -5,14 +5,14 @@ static void Constructor(const v8::FunctionCallbackInfo& info) { V8_GET_ISOLATE_CONTEXT(); - V8_CHECK_CONSTRUCTOR() + V8_CHECK_CONSTRUCTOR(); - V8_CHECK_ARGS_LEN(3) - V8_ARG_TO_UINT(1, interiorId) - V8_ARG_TO_UINT(2, portalIndex) + V8_CHECK_ARGS_LEN(2); + V8_ARG_TO_UINT(1, interiorId); + V8_ARG_TO_UINT(2, portalIndex); std::shared_ptr interior = alt::ICore::Instance().GetInterior(interiorId); - V8_CHECK(interior, "interior doesn't exist") + V8_CHECK(interior, "interior doesn't exist"); std::shared_ptr portal = interior->GetPortalByIndex(portalIndex); V8_CHECK(portal, "interior portal doesn't exist"); diff --git a/client/src/bindings/InteriorRoom.cpp b/client/src/bindings/InteriorRoom.cpp index ef19a595..c5bd1644 100644 --- a/client/src/bindings/InteriorRoom.cpp +++ b/client/src/bindings/InteriorRoom.cpp @@ -19,7 +19,6 @@ static void Constructor(const v8::FunctionCallbackInfo& info) if(isIndex) { room = interior->GetRoomByIndex(value); - V8_CHECK(room, "interior room doesn't exist"); } else {