mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 04:51:19 +00:00
- Fixed: checkz wasn't used.
- Use 0 instead of false.
This commit is contained in:
parent
fefdb266cd
commit
dcfdb50307
1 changed files with 5 additions and 3 deletions
|
@ -271,13 +271,15 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, GetDistance)
|
|||
|
||||
if (!target || target == self)
|
||||
{
|
||||
ret->SetFloat(false);
|
||||
ret->SetFloat(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
fixedvec3 diff = self->Vec3To(target);
|
||||
diff.z += (target->height - self->height) / 2;
|
||||
const double length = TVector3<double>(FIXED2DBL(diff.x), FIXED2DBL(diff.y), FIXED2DBL(diff.z)).Length();
|
||||
if (checkz)
|
||||
diff.z += (target->height - self->height) / 2;
|
||||
|
||||
const double length = TVector3<double>(FIXED2DBL(diff.x), FIXED2DBL(diff.y), (checkz) ? FIXED2DBL(diff.z) : 0).Length();
|
||||
ret->SetFloat(length);
|
||||
}
|
||||
return 1;
|
||||
|
|
Loading…
Reference in a new issue