From 48c4f7181dd19160f37ec9aa1eb7fb77697d7029 Mon Sep 17 00:00:00 2001 From: xshady <54737754+xxshady@users.noreply.github.com> Date: Sun, 17 Nov 2024 13:39:33 +0300 Subject: [PATCH] feat(client): add InteriorPortal entityCount (#333) --- client/src/bindings/InteriorPortal.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/src/bindings/InteriorPortal.cpp b/client/src/bindings/InteriorPortal.cpp index 58c62cbb8..a461f209f 100644 --- a/client/src/bindings/InteriorPortal.cpp +++ b/client/src/bindings/InteriorPortal.cpp @@ -141,6 +141,13 @@ static void GetCornerPos(const v8::FunctionCallbackInfo& info) } +static void EntityCountGetter(v8::Local, const v8::PropertyCallbackInfo& info) +{ + GET_THIS_INTERIOR_PORTAL(portal); + + V8_RETURN_UINT(portal->GetEntityCount()); +} + static void SetCornerPos(const v8::FunctionCallbackInfo& info) { GET_THIS_INTERIOR_PORTAL(portal); @@ -165,6 +172,7 @@ extern V8Class v8InteriorPortal("InteriorPortal", V8Helpers::SetAccessor(isolate, tpl, "roomFrom", &RoomFromGetter, &RoomFromSetter); V8Helpers::SetAccessor(isolate, tpl, "roomTo", &RoomToGetter, &RoomToSetter); V8Helpers::SetAccessor(isolate, tpl, "flag", &FlagGetter, &FlagSetter); + V8Helpers::SetAccessor(isolate, tpl, "entityCount", &EntityCountGetter); V8Helpers::SetMethod(isolate, tpl, "getCornerPos", &GetCornerPos); V8Helpers::SetMethod(isolate, tpl, "getEntityArchetype", &GetEntityArchetype);