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?