Increase maximum treasure priority distance and check that a dropsite has nearby resources

This was SVN commit r11840.
This commit is contained in:
Jonathan Waller 2012-05-11 22:44:37 +00:00
parent fbc3cbad7c
commit 4a73b85a4b

View File

@ -105,7 +105,7 @@ Worker.prototype.startGathering = function(gameState){
}
});
if (!nearestResources){
if (!nearestResources || nearestResources.length === 0){
nearestResources = gameState.getResourceSupplies(resource);
gameState.getOwnDropsites(resource).forEach(function (dropsite){
if (dropsite.position()){
@ -142,7 +142,7 @@ Worker.prototype.startGathering = function(gameState){
}
// Go for treasure as a priority
if (dist < 200 && supply.resourceSupplyType().generic == "treasure"){
if (dist < 1000 && supply.resourceSupplyType().generic == "treasure"){
dist /= 1000;
}