diff options
| author | LagoLunatic <LagoLunatic@users.noreply.github.com> | 2025-08-08 21:51:30 -0400 |
|---|---|---|
| committer | LagoLunatic <LagoLunatic@users.noreply.github.com> | 2025-08-08 21:51:30 -0400 |
| commit | 5802571a5680c65e2fcdd39bceac26d42f490d64 (patch) | |
| tree | 371d72242beb595fd0887c025846062cf7a75efa /src/d/actor/d_a_bst.cpp | |
| parent | b24d8574cdef4f7e4521b2b0c72e0a8775706d9c (diff) | |
Add SQUARE macro to improve readibility for distances
Diffstat (limited to 'src/d/actor/d_a_bst.cpp')
| -rw-r--r-- | src/d/actor/d_a_bst.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/d/actor/d_a_bst.cpp b/src/d/actor/d_a_bst.cpp index 25a436ab..4bbd0a7b 100644 --- a/src/d/actor/d_a_bst.cpp +++ b/src/d/actor/d_a_bst.cpp @@ -1147,8 +1147,8 @@ static void damage_check(bst_class* i_this) { cXyz player_vec = i_this->current.pos - player->current.pos; i_this->mHurtRecoilAngle1 = cM_atan2s(player_vec.x, player_vec.z); - f32 xz = player_vec.x * player_vec.x + player_vec.z * player_vec.z; - i_this->mHurtRecoilAngle2 = -cM_atan2s(player_vec.y, std::sqrtf(xz)); + f32 xz2 = SQUARE(player_vec.x) + SQUARE(player_vec.z); + i_this->mHurtRecoilAngle2 = -cM_atan2s(player_vec.y, std::sqrtf(xz2)); i_this->speedF = 0.0f; |
