Thread: WOD/Pre-patch
View Single Post
12-10-14, 07:55 AM   #734
ircdirk
A Molten Giant
 
ircdirk's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2014
Posts: 823
Code:
function coords2grid($coords, $radius = 5, $shrink) {
	$grid = newgrid();
	$points = newgrid();

	for ($c = 0; $c < count($coords); $c++) {
		$cx = round($coords[$c]['x']);
		$cy = round($coords[$c]['y']);

		if ($points[$cx][$cy] == 1) { continue; }
		$points[$cx][$cy] = 1;

		$rx = $radius;
		$ry = 0;
		$rerr = $radius;
                ...
After testing i see that cords must be 2 points after digit becouse they will not show on map in the right place. So rounding them like that puts them on the map in bad spot. Also result coords MUST be 2 points after digit (2 points precision must be used everywere). Atl77 can u make changes to your script?

Another thing is that after calculation every point has height = 1, but height must be calculated also becouse the result is like this:


Last edited by ircdirk : 12-10-14 at 08:10 AM.