// Safe Zone Handler.
// Worthless Bums 2012.


// Creates a safe zone around the squad.
function getSafeZone ()
{//echo("getSafeZone()");
	// Buffer around each squad member.
	%buffer = 2;
	
	// Get squad boundaries.
	%boundaries = getSquadBoundaries();
	%minX = getWord(%boundaries, 0);
	%maxX = getWord(%boundaries, 1);
	%minY = getWord(%boundaries, 2);
	%maxY = getWord(%boundaries, 3);
	
	// Round all values to an integer value just in case!
	%minX = mFloor(%minX);
	%maxX = mFloor(%maxX);
	%minY = mFloor(%minY);
	%maxY = mFloor(%maxY);
	//echo("%minX SPC %maxX SPC %minY SPC %maxY =" SPC %minX SPC %maxX SPC %minY SPC %maxY);
	
	// Factor in the buffer.
	%minX -= %buffer;
	%maxX += %buffer;
	%minY -= %buffer;
	%maxY += %buffer;
	
	// Return boundaries.
	return %minX SPC %maxX SPC %minY SPC %maxY;
}