Skip to content

Commit

Permalink
feat(skymp5-server): blocking
Browse files Browse the repository at this point in the history
  • Loading branch information
Pospelove committed Nov 5, 2023
1 parent 072fb7b commit 7e63267
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 @@ -894,9 +894,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 7e63267

Please sign in to comment.