Skip to content

Commit

Permalink
client: add playerStartTalking, playerStopTalking
Browse files Browse the repository at this point in the history
  • Loading branch information
zziger committed Sep 22, 2023
1 parent 702a6b3 commit e742832
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
20 changes: 20 additions & 0 deletions client/src/events/Entity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,23 @@ V8_LOCAL_EVENT_HANDLER entityHitEntity(EventType::ENTITY_HIT_ENTITY,
args.push_back(resource->GetBaseObjectOrNull(ev->GetTarget()));
args.push_back(V8Helpers::JSValue(ev->GetWeapon()));
});

V8_LOCAL_EVENT_HANDLER playerStartTalking(EventType::PLAYER_START_TALKING,
"playerStartTalking",
[](V8ResourceImpl* resource, const CEvent* e, std::vector<v8::Local<v8::Value>>& args)
{
auto ev = static_cast<const alt::CPlayerStartTalkingEvent*>(e);
v8::Isolate* isolate = resource->GetIsolate();

args.push_back(resource->GetBaseObjectOrNull(ev->GetPlayer()));
});

V8_LOCAL_EVENT_HANDLER playerStopTalking(EventType::PLAYER_STOP_TALKING,
"playerStopTalking",
[](V8ResourceImpl* resource, const CEvent* e, std::vector<v8::Local<v8::Value>>& args)
{
auto ev = static_cast<const alt::CPlayerStopTalkingEvent*>(e);
v8::Isolate* isolate = resource->GetIsolate();

args.push_back(resource->GetBaseObjectOrNull(ev->GetPlayer()));
});
2 changes: 1 addition & 1 deletion shared/deps/cpp-sdk

0 comments on commit e742832

Please sign in to comment.