diff options
author | frosch <frosch@openttd.org> | 2011-08-19 21:19:10 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2011-08-19 21:19:10 +0000 |
commit | 27aff44e77493ca87d6b75fa99c972a5035a42dc (patch) | |
tree | eecb0ecd8be2670ac6cd63317b0eaf0b1654ed2e /src/ai/api/ai_tile.cpp | |
parent | b8f8cef34c1d75da025db9216a3f798ff8f74f3b (diff) | |
download | openttd-27aff44e77493ca87d6b75fa99c972a5035a42dc.tar.xz |
(svn r22764) -Add: [NoAI] AITile::GetTownAuthority().
Diffstat (limited to 'src/ai/api/ai_tile.cpp')
-rw-r--r-- | src/ai/api/ai_tile.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ai/api/ai_tile.cpp b/src/ai/api/ai_tile.cpp index 671567190..98701b3a0 100644 --- a/src/ai/api/ai_tile.cpp +++ b/src/ai/api/ai_tile.cpp @@ -268,6 +268,13 @@ return AITown::IsWithinTownInfluence(town_id, tile); } +/* static */ TownID AITile::GetTownAuthority(TileIndex tile) +{ + if (!::IsValidTile(tile)) return false; + + return ::ClosestTownFromTile(tile, _settings_game.economy.dist_local_authority)->index; +} + /* static */ TownID AITile::GetClosestTown(TileIndex tile) { if (!::IsValidTile(tile)) return INVALID_TOWN; |