summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2009-01-12 18:15:18 +0000
committertruebrain <truebrain@openttd.org>2009-01-12 18:15:18 +0000
commitc666cf5a4914626227d7a47153893362302f22c7 (patch)
tree5ad437eb3f4098a48052d3a21cfcf9577ee3dd56 /src
parent324e256dfda30f37b38fc16b2bc3bb824a6c82ff (diff)
downloadopenttd-c666cf5a4914626227d7a47153893362302f22c7.tar.xz
(svn r15036) -Fix: use the same value for 'random' through-out the code for PlantTree
Diffstat (limited to 'src')
-rw-r--r--src/ai/api/ai_tile.cpp4
-rw-r--r--src/tree_gui.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/ai/api/ai_tile.cpp b/src/ai/api/ai_tile.cpp
index 868cc679a..fd694373f 100644
--- a/src/ai/api/ai_tile.cpp
+++ b/src/ai/api/ai_tile.cpp
@@ -213,7 +213,7 @@
{
EnforcePrecondition(false, ::IsValidTile(tile));
- return AIObject::DoCommand(tile, -1, tile, CMD_PLANT_TREE);
+ return AIObject::DoCommand(tile, UINT_MAX, tile, CMD_PLANT_TREE);
}
/* static */ bool AITile::PlantTreeRectangle(TileIndex tile, uint width, uint height)
@@ -223,7 +223,7 @@
EnforcePrecondition(false, height >= 1 && height <= 20);
TileIndex end_tile = tile + ::TileDiffXY(width - 1, height - 1);
- return AIObject::DoCommand(tile, -1, end_tile, CMD_PLANT_TREE);
+ return AIObject::DoCommand(tile, UINT_MAX, end_tile, CMD_PLANT_TREE);
}
/* static */ bool AITile::IsWithinTownInfluence(TileIndex tile, TownID town_id)
diff --git a/src/tree_gui.cpp b/src/tree_gui.cpp
index 5e3f47597..990f784da 100644
--- a/src/tree_gui.cpp
+++ b/src/tree_gui.cpp
@@ -23,7 +23,7 @@ class BuildTreesWindow : public Window
{
uint16 base;
uint16 count;
- int tree_to_plant;
+ uint tree_to_plant;
enum BuildTreesWidgets {
BTW_CLOSE,
@@ -105,7 +105,7 @@ public:
case BTW_TYPE_RANDOM: // tree of random type.
if (HandlePlacePushButton(this, BTW_TYPE_RANDOM, SPR_CURSOR_TREE, VHM_RECT, NULL)) {
- this->tree_to_plant = -1;
+ this->tree_to_plant = UINT_MAX;
}
break;