Skip to content

Commit

Permalink
Update ActionListener.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Pospelove authored Nov 17, 2023
1 parent 4aec267 commit 7ae5ea5
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions skymp5-server/cpp/server_guest_lib/ActionListener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -832,25 +832,25 @@ void ActionListener::OnHit(const RawMessageData& rawMsgData_,
return;
}

if (IsDistanceValid(*aggressor, targetActor, hitData) == false) {
float distance =
std::sqrt(GetSqrDistanceToBounds(*aggressor, targetActor));

// TODO: fix bounding boxes for creatures such as chicken, mudcrab, etc
float reachPveHotfixMult =
(aggressor->GetBaseId() <= 0x7 && targetActor.GetBaseId() <= 0x7)
? 1.f
: std::numeric_limits<float>::infinity();

float reach = GetReach(*aggressor, hitData.source, reachPveHotfixMult);
uint32_t aggressorId = aggressor->GetFormId();
uint32_t targetId = targetActor.GetFormId();
spdlog::debug(
fmt::format("{:x} actor can't reach {:x} target because distance {} is "
"greater then first actor attack radius {}",
aggressorId, targetId, distance, reach));
return;
}
// if (IsDistanceValid(*aggressor, targetActor, hitData) == false) {
// float distance =
// std::sqrt(GetSqrDistanceToBounds(*aggressor, targetActor));

// // TODO: fix bounding boxes for creatures such as chicken, mudcrab, etc
// float reachPveHotfixMult =
// (aggressor->GetBaseId() <= 0x7 && targetActor.GetBaseId() <= 0x7)
// ? 1.f
// : std::numeric_limits<float>::infinity();

// float reach = GetReach(*aggressor, hitData.source, reachPveHotfixMult);
// uint32_t aggressorId = aggressor->GetFormId();
// uint32_t targetId = targetActor.GetFormId();
// spdlog::debug(
// fmt::format("{:x} actor can't reach {:x} target because distance {} is "
// "greater then first actor attack radius {}",
// aggressorId, targetId, distance, reach));
// return;
// }

ActorValues currentActorValues = targetActor.GetChangeForm().actorValues;

Expand Down

0 comments on commit 7ae5ea5

Please sign in to comment.