update/fix AI and tweak map parameters
Iris Lightshard nilix@nilfm.cc
PGP Signature
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEkFh6dA+k/6CXFXU4O3+8IhROY5gFAmDRZN0ACgkQO3+8IhRO Y5jU0hAAibUhOQ5CMS0yN0fEZHY6uPMJVYBNV1jxHm4PTciFyESTLLyXvLdNZ023 +B8Iy/R8KvxlLl+nYQsGVSzAF6H8gnhG3RMA5NYTA3BVJTRnEOtT4mxRdGIE93OJ NcA5p/C7qzG1XOEBaDfgP1saRo8Vo3qo7QVD1jMmoK53ubxiM8aF9YSVR/+Lj65f nSdE44lBdHWGyzJ/xA7yF5qIhxOC5ple2moSUTgQBmKYDO80RRG/T7DNDM7OrjTb Y0WXBIhJJ8ymzWbtT8fhXwSl6xFda4uAQQmijCAL+ipEWhtdI/JIIFmC9HlheU6u G8V6TTY8f9JaO69fQDAgPVVacYseWG3W3ytdwr34DrCCTiRuOVgqFlomdL0vKCJj NJCBa1oJ4GDbyZGMnG6jAVlFlF9FULlTyjixd3Jbtz3bF/G0500ISF6bJHYRTODp ttOk64+lQOv98PbCiviTyYtVzb/4pzIiF4vk4y96HLnfF2ls84OLsHl5I7Vng4k/ tONTskZl93+vHC2TwwV/vgjkdXyUksTUIa6Bd7Yux/8zYT60tTbbADBxTXPx73Qn VQoprWjmqBBeN4itrA3tA/hCk+ZV6BqW3gkhJ9Yx0BjazG4ErT3QIRcOotiLHoy7 veg9Em66OkijwfrSijdk3d4DYznL14Vcuh8WCA9p9/b6udgjQpU= =mPdT -----END PGP SIGNATURE-----
M
AI.js
→
AI.js
@@ -831,7 +831,8 @@ AI.targetReset = function(target)
{ for (var i = 0; i < teams.cpu.units.length; i++) { - if (teams.cpu.units[i].target.x == target.x && + if (teams.cpu.units[i].target && + teams.cpu.units[i].target.x == target.x && teams.cpu.units[i].target.y == target.y) { teams.cpu.units[i].attentionSpan = 0;
M
Map.js
→
Map.js
@@ -567,12 +567,12 @@ }
map.generate = function() { - this.loadTiles(); - this.init() - this.fillPlains(); - this.genForests(0.5); - this.genMountains(Math.floor(Math.random()*this.sz/8), Math.floor(Math.random()*map.sz/6), 9); - this.genCities(Math.floor(Math.random()*this.sz/7 + 3), 5, 4); - this.fillOcean(Math.floor(Math.random()*map.sz/8) + Math.floor(Math.random()*Math.sqrt(map.sz)), Math.floor(Math.random()*9) + 1); - this.countCities(); + map.loadTiles(); + map.init() + map.fillPlains(); + map.genForests(0.5); + map.genMountains(Math.floor(Math.random()*map.sz/4 + 4), Math.floor(Math.random()*map.sz/6), map.sz/4); + map.genCities(Math.floor(Math.random()*map.sz/7 + 3), 5, 4); + map.fillOcean(map.sz/8 + Math.floor(Math.random()*map.sz/8), Math.floor(Math.random()*9) + 1); + map.countCities(); }