From 18750f792262d6025d2485e6d960096761db02b4 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Mon, 9 Apr 2007 10:05:51 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@946 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/worldocull.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/source/src/worldocull.cpp b/source/src/worldocull.cpp index f2397b43..80f0632f 100644 --- a/source/src/worldocull.cpp +++ b/source/src/worldocull.cpp @@ -72,13 +72,11 @@ int isoccluded(float vx, float vy, float cx, float cy, float csize) // v = v { if(!ocull || minimap) return 0; - float nx = vx, ny = vy; // n = point on the border of the cube that is closest to v - if(nxcx+csize) nx = cx+csize; - if(nycy+csize) ny = cy+csize; - float xdist = (float)fabs(nx-vx); - float ydist = (float)fabs(ny-vy); + float xdist = 0, ydist = 0; // distance from point on the border of the cube that is closest to v + if(vxcx+csize) xdist = vx-(cx+csize); + if(vycy+csize) ydist = vy-(cy+csize); if(xdist>odist || ydist>odist) return 2; float dist = xdist+ydist-1; // 1 needed?