summaryrefslogtreecommitdiff
path: root/src/ai
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2009-07-08 17:42:58 +0000
committeryexo <yexo@openttd.org>2009-07-08 17:42:58 +0000
commit369d4ce17932a3ad4deb19319c35d54232eb98a2 (patch)
treeeb5fd9f620c59ffecbf493f7cb29fb5e3c7f329d /src/ai
parent9ae07bba8546ab1f1cdf4f58c9b31af944325c43 (diff)
downloadopenttd-369d4ce17932a3ad4deb19319c35d54232eb98a2.tar.xz
(svn r16767) -Fix [NoAI] (r16524): AITile::GetCargoProduction/Acceptance didn't accept a radius of 0 anymore
Diffstat (limited to 'src/ai')
-rw-r--r--src/ai/api/ai_tile.cpp4
-rw-r--r--src/ai/api/ai_tile.hpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/ai/api/ai_tile.cpp b/src/ai/api/ai_tile.cpp
index ea13fe456..f54285477 100644
--- a/src/ai/api/ai_tile.cpp
+++ b/src/ai/api/ai_tile.cpp
@@ -177,7 +177,7 @@
/* static */ int32 AITile::GetCargoAcceptance(TileIndex tile, CargoID cargo_type, int width, int height, int radius)
{
- if (!::IsValidTile(tile) || width <= 0 || height <= 0 || radius <= 0) return -1;
+ if (!::IsValidTile(tile) || width <= 0 || height <= 0 || radius < 0) return -1;
CargoArray acceptance = ::GetAcceptanceAroundTiles(tile, width, height, _settings_game.station.modified_catchment ? radius : (int)CA_UNMODIFIED);
return acceptance[cargo_type];
@@ -185,7 +185,7 @@
/* static */ int32 AITile::GetCargoProduction(TileIndex tile, CargoID cargo_type, int width, int height, int radius)
{
- if (!::IsValidTile(tile) || width <= 0 || height <= 0 || radius <= 0) return -1;
+ if (!::IsValidTile(tile) || width <= 0 || height <= 0 || radius < 0) return -1;
CargoArray produced = ::GetProductionAroundTiles(tile, width, height, _settings_game.station.modified_catchment ? radius : (int)CA_UNMODIFIED);
return produced[cargo_type];
diff --git a/src/ai/api/ai_tile.hpp b/src/ai/api/ai_tile.hpp
index 965a829f6..78abfde73 100644
--- a/src/ai/api/ai_tile.hpp
+++ b/src/ai/api/ai_tile.hpp
@@ -305,7 +305,7 @@ public:
* @pre AIMap::IsValidTile(tile).
* @pre width > 0.
* @pre height > 0.
- * @pre radius > 0.
+ * @pre radius >= 0.
* @return Value below 8 means no acceptance; the more the better.
*/
static int32 GetCargoAcceptance(TileIndex tile, CargoID cargo_type, int width, int height, int radius);
@@ -322,7 +322,7 @@ public:
* @pre AIMap::IsValidTile(tile).
* @pre width > 0.
* @pre height > 0.
- * @pre radius > 0.
+ * @pre radius >= 0.
* @return The tiles that produce this cargo within radius of the tile.
* @note Town(houses) are not included in the value.
*/