Skip to content

Commit

Permalink
fix: fix PlayerAttackEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
ShrBox committed Jan 4, 2025
1 parent f948a8d commit 36f0ad6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/ll/api/event/player/PlayerAttackEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,18 @@ LL_TYPE_INSTANCE_HOOK(
PlayerAttackEventHook,
HookPriority::Normal,
Player,
&Player::$attack,
&Player::_attack,
bool,
Actor& ac,
ActorDamageCause const& cause
ActorDamageCause const& cause,
bool doPredictiveSound
) {
auto ev = PlayerAttackEvent(*this, ac, cause);
EventBus::getInstance().publish(ev);
if (ev.isCancelled()) {
return false;
}
return origin(ac, cause);
return origin(ac, cause, doPredictiveSound);
}

static std::unique_ptr<EmitterBase> emitterFactory();
Expand Down

0 comments on commit 36f0ad6

Please sign in to comment.