Skip to content

Commit

Permalink
server: add playerheal event
Browse files Browse the repository at this point in the history
  • Loading branch information
C0kkie committed Aug 29, 2023
1 parent ff4d964 commit c89f685
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions server/src/events/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,3 +218,17 @@ V8_LOCAL_EVENT_HANDLER playerSpawn(EventType::PLAYER_SPAWN,

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

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

args.push_back(resource->GetBaseObjectOrNull(ev->GetTarget()));
args.push_back(V8Helpers::JSValue(ev->GetOldHealth()));
args.push_back(V8Helpers::JSValue(ev->GetNewHealth()));
args.push_back(V8Helpers::JSValue(ev->GetOldArmour()));
args.push_back(V8Helpers::JSValue(ev->GetNewArmour()));
});

0 comments on commit c89f685

Please sign in to comment.