mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-11 15:22:16 +00:00
- Fixed: The coordinates need to be converted to doubles first. Also use length instead of length squared.
This commit is contained in:
parent
e04fe06226
commit
fefdb266cd
1 changed files with 2 additions and 2 deletions
|
@ -277,8 +277,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, GetDistance)
|
|||
{
|
||||
fixedvec3 diff = self->Vec3To(target);
|
||||
diff.z += (target->height - self->height) / 2;
|
||||
const double lengthsquared = TVector3<double>(diff.x, diff.y, diff.z).LengthSquared();
|
||||
ret->SetFloat(lengthsquared);
|
||||
const double length = TVector3<double>(FIXED2DBL(diff.x), FIXED2DBL(diff.y), FIXED2DBL(diff.z)).Length();
|
||||
ret->SetFloat(length);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue