Ticket #3968: remove_duplicated_getDistance.patch
File remove_duplicated_getDistance.patch, 894 bytes (added by , 8 years ago) |
---|
-
binaries/data/mods/public/maps/random/rmgen2/setup.js
134 134 } 135 135 136 136 /** 137 * Euclidian distance between two points.138 */139 function euclid_distance(x1, z1, x2, z2)140 {141 return Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(z2 - z1, 2));142 }143 144 /**145 137 * Chose starting locations for the given players. 146 138 * 147 139 * @param {string} type - "radial", "stacked", "stronghold", "random" … … 445 437 var tooClose = false; 446 438 for (var j = 0; j < placed.length; ++j) 447 439 { 448 var sep = euclid_distance(x, z, placed[j].x, placed[j].z);440 var sep = getDistance(x, z, placed[j].x, placed[j].z); 449 441 if (sep < 0.25) 450 442 { 451 443 tooClose = true;