Skip to content

Commit

Permalink
fix: fix onAttackEntity
Browse files Browse the repository at this point in the history
  • Loading branch information
ShrBox committed Jan 28, 2024
1 parent 9547b53 commit b972ee9
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/api/EventAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,19 +409,19 @@ void EnableEventListener(int eventId) {
});
break;

// case EVENT_TYPES::onAttackEntity:
// Event::PlayerAttackEvent::subscribe([](const PlayerAttackEvent &ev) {
// IF_LISTENED(EVENT_TYPES::onAttackEntity) {
// if (ev.mTarget) {
// CallEvent(EVENT_TYPES::onAttackEntity,
// PlayerClass::newPlayer(ev.mPlayer),
// EntityClass::newEntity(ev.mTarget),
// Number::newNumber(ev.mAttackDamage));
// }
// }
// IF_LISTENED_END(EVENT_TYPES::onAttackEntity);
// });
// break;
case EVENT_TYPES::onAttackEntity:
bus.emplaceListener<PlayerAttackEvent>([](PlayerAttackEvent& ev) {
IF_LISTENED(EVENT_TYPES::onAttackEntity) {
CallEvent(
EVENT_TYPES::onAttackEntity,
PlayerClass::newPlayer(&ev.self()),
EntityClass::newEntity(&ev.target())
);
}
IF_LISTENED_END(EVENT_TYPES::onAttackEntity);
});
break;
break;

// case EVENT_TYPES::onAttackBlock:
// Event::PlayerAttackBlockEvent::subscribe(
Expand Down

0 comments on commit b972ee9

Please sign in to comment.