From dcfdb503075bcddb92df97a91d32cf10147d98ad Mon Sep 17 00:00:00 2001 From: MajorCooke Date: Wed, 10 Feb 2016 18:04:59 -0600 Subject: [PATCH] - Fixed: checkz wasn't used. - Use 0 instead of false. --- src/thingdef/thingdef_codeptr.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 0949dd6a6..2eb53c87d 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -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(FIXED2DBL(diff.x), FIXED2DBL(diff.y), FIXED2DBL(diff.z)).Length(); + if (checkz) + diff.z += (target->height - self->height) / 2; + + const double length = TVector3(FIXED2DBL(diff.x), FIXED2DBL(diff.y), (checkz) ? FIXED2DBL(diff.z) : 0).Length(); ret->SetFloat(length); } return 1;