Skip to content

Commit

Permalink
server: add player clearClothes
Browse files Browse the repository at this point in the history
  • Loading branch information
C0kkie committed Oct 22, 2023
1 parent 0a5e1c5 commit 5ddb005
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions server/src/bindings/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,17 @@ static void GetDlcClothes(const v8::FunctionCallbackInfo<v8::Value>& info)
V8_RETURN(clothes);
}

static void ClearClothes(const v8::FunctionCallbackInfo<v8::Value>& info)
{
V8_GET_ISOLATE_CONTEXT();
V8_GET_THIS_BASE_OBJECT(player, IPlayer);

V8_CHECK_ARGS_LEN(1);
V8_ARG_TO_UINT(1, component);

player->ClearClothes(component);
}

static void SetProps(const v8::FunctionCallbackInfo<v8::Value>& info)
{
V8_GET_ISOLATE_CONTEXT();
Expand Down Expand Up @@ -1535,6 +1546,7 @@ extern V8Class v8Player("Player",
V8Helpers::SetMethod(isolate, tpl, "setDlcClothes", &SetDlcClothes);
V8Helpers::SetMethod(isolate, tpl, "getClothes", &GetClothes);
V8Helpers::SetMethod(isolate, tpl, "getDlcClothes", &GetDlcClothes);
V8Helpers::SetMethod(isolate, tpl, "clearClothes", &ClearClothes);

V8Helpers::SetMethod(isolate, tpl, "setProp", &SetProps);
V8Helpers::SetMethod(isolate, tpl, "setDlcProp", &SetDlcProps);
Expand Down
2 changes: 1 addition & 1 deletion shared/deps/cpp-sdk
Submodule cpp-sdk updated 1 files
+1 −0 objects/IPlayer.h

0 comments on commit 5ddb005

Please sign in to comment.