Skip to content

Commit

Permalink
fix(skymp5-server): make blocking more precise (#1729)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pospelove authored Nov 6, 2023
1 parent ecd3a33 commit 9ab5212
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions skymp5-server/cpp/server_guest_lib/ActionListener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -844,9 +844,10 @@ void ActionListener::OnHit(const RawMessageData& rawMsgData_,

float healthPercentage = currentActorValues.healthPercentage;

hitData.isHitBlocked = targetActor.IsBlockActive()
? ShouldBeBlocked(*aggressor, targetActor)
: false;
hitData.isHitBlocked = hitData.isHitBlocked ||
(targetActor.IsBlockActive() ? ShouldBeBlocked(*aggressor, targetActor)
: false);

float damage = partOne.CalculateDamage(*aggressor, targetActor, hitData);
damage = damage < 0.f ? 0.f : damage;
float outBaseHealth = 0.f;
Expand Down

0 comments on commit 9ab5212

Please sign in to comment.