From 37f95e0349a334a5bc8d4a27b563719e72590f42 Mon Sep 17 00:00:00 2001 From: terminx Date: Mon, 25 Feb 2008 07:31:39 +0000 Subject: [PATCH] git-svn-id: https://svn.eduke32.com/eduke32@628 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/sector.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/polymer/eduke32/source/sector.c b/polymer/eduke32/source/sector.c index 4dce0adac..b366ead48 100644 --- a/polymer/eduke32/source/sector.c +++ b/polymer/eduke32/source/sector.c @@ -198,12 +198,16 @@ inline int checkcursectnums(int sect) inline int ldist(spritetype *s1,spritetype *s2) { - return (FindDistance2D(s1->x-s2->x, s1->y-s2->y)); + int i = FindDistance2D(s1->x-s2->x, s1->y-s2->y); + if (!i) return 1; + return i; } inline int dist(spritetype *s1,spritetype *s2) { - return (FindDistance3D(s1->x-s2->x, s1->y-s2->y, (s1->z-s2->z)>>4)); + int i = FindDistance3D(s1->x-s2->x, s1->y-s2->y, (s1->z-s2->z)>>4); + if (!i) return 1; + return i; } int findplayer(spritetype *s,int *d)