(svn r18717) -Codechange: use TileArea in industry instead of three separate variables. Also make use of TileArea functions for determining the 'width' and 'height' of an industry.

This commit is contained in:
rubidium
2010-01-04 18:21:07 +00:00
parent 71f2789270
commit 87466a4ed0
14 changed files with 71 additions and 81 deletions

View File

@@ -236,7 +236,7 @@ static Subsidy *FindSubsidyCargoRoute()
/* Only want big towns */
if (t->population < SUBSIDY_CARGO_MIN_POPULATION) return NULL;
if (DistanceManhattan(i->xy, t->xy) > SUBSIDY_MAX_DISTANCE) return NULL;
if (DistanceManhattan(i->location.tile, t->xy) > SUBSIDY_MAX_DISTANCE) return NULL;
dst = t->index;
} else {
@@ -252,7 +252,7 @@ static Subsidy *FindSubsidyCargoRoute()
return NULL;
}
if (DistanceManhattan(i->xy, i2->xy) > SUBSIDY_MAX_DISTANCE) return NULL;
if (DistanceManhattan(i->location.tile, i2->location.tile) > SUBSIDY_MAX_DISTANCE) return NULL;
dst = i2->index;
}