From 636f9d4ae54f69bf20b3940b2e7d5283d70dce0a Mon Sep 17 00:00:00 2001 From: xLuxy <67131061+xLuxy@users.noreply.github.com> Date: Wed, 3 Jan 2024 16:44:11 +0100 Subject: [PATCH] feat(server): Add count param to `Player.addDecoration` --- server/src/bindings/Player.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/server/src/bindings/Player.cpp b/server/src/bindings/Player.cpp index 653105c0..37de52c5 100644 --- a/server/src/bindings/Player.cpp +++ b/server/src/bindings/Player.cpp @@ -1335,7 +1335,7 @@ static void SetAmmoMax100(const v8::FunctionCallbackInfo& info) static void AddDecoration(const v8::FunctionCallbackInfo& info) { V8_GET_ISOLATE_CONTEXT(); - V8_CHECK_ARGS_LEN(2); + V8_CHECK_ARGS_LEN_MIN_MAX(2, 3); V8_GET_THIS_BASE_OBJECT(player, IPlayer); uint32_t collectionHash; @@ -1362,7 +1362,14 @@ static void AddDecoration(const v8::FunctionCallbackInfo& info) overlayHash = alt::ICore::Instance().Hash(overlay); } - player->AddDecoration(collectionHash, overlayHash); + uint8_t count = 1; + if (info[2]->IsNumber()) + { + V8_ARG_TO_UINT(3, _count); + count = _count; + } + + player->AddDecoration(collectionHash, overlayHash, count); } static void RemoveDecoration(const v8::FunctionCallbackInfo& info)