Ticket #4012: map.js2016-6-11.patch
File map.js2016-6-11.patch, 878 bytes (added by , 8 years ago) |
---|
-
binaries/data/mods/public/maps/random/rmgen/map.js
88 88 } 89 89 90 90 // Check bounds on tile map 91 Map.prototype.validT = function(x, z, distance )91 Map.prototype.validT = function(x, z, distance = 0) 92 92 { 93 93 if (g_MapSettings.CircularMap) 94 94 { // Within map circle 95 95 var halfSize = Math.floor(0.5*this.size); 96 96 var dx = (x - halfSize); 97 97 var dz = (z - halfSize); 98 if (distance === undefined) 99 return Math.round(Math.sqrt(dx*dx + dz*dz)) < halfSize - 1; 100 else 101 return Math.round(Math.sqrt(dx*dx + dz*dz)) < halfSize - distance - 1; 98 return Math.round(Math.sqrt(dx*dx + dz*dz)) < halfSize - distance - 1; 102 99 } 103 100 else 104 101 // Within map square