mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-14 08:30:50 +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);
|
fixedvec3 diff = self->Vec3To(target);
|
||||||
diff.z += (target->height - self->height) / 2;
|
diff.z += (target->height - self->height) / 2;
|
||||||
const double lengthsquared = TVector3<double>(diff.x, diff.y, diff.z).LengthSquared();
|
const double length = TVector3<double>(FIXED2DBL(diff.x), FIXED2DBL(diff.y), FIXED2DBL(diff.z)).Length();
|
||||||
ret->SetFloat(lengthsquared);
|
ret->SetFloat(length);
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue