From 3a5970eb4c2eaf8dbfcfbbe06b4f1d81d22262a3 Mon Sep 17 00:00:00 2001 From: LeonMrBonnie Date: Tue, 4 Jan 2022 18:40:20 +0100 Subject: [PATCH] server: Add isEntityInStreamRange overload with entity id Former-commit-id: 46d2cad93e160948d5052a3a9cc127183409e371 --- server/src/bindings/Player.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/server/src/bindings/Player.cpp b/server/src/bindings/Player.cpp index fb8a0554..89bc40eb 100644 --- a/server/src/bindings/Player.cpp +++ b/server/src/bindings/Player.cpp @@ -346,9 +346,16 @@ static void IsEntityInStreamRange(const v8::FunctionCallbackInfo& inf V8_CHECK_ARGS_LEN(1); V8_GET_THIS_BASE_OBJECT(player, IPlayer); - V8_ARG_TO_BASE_OBJECT(1, entity, IEntity, "Entity"); - - V8_RETURN_BOOLEAN(player->IsEntityInStreamingRange(entity)); + if(info[0]->IsNumber()) + { + V8_ARG_TO_UINT(1, entity); + V8_RETURN_BOOLEAN(player->IsEntityInStreamingRange(entity)); + } + else + { + V8_ARG_TO_BASE_OBJECT(1, entity, IEntity, "Entity"); + V8_RETURN_BOOLEAN(player->IsEntityInStreamingRange(entity)); + } } static void SetIntoVehicle(const v8::FunctionCallbackInfo& info)