mirror of https://github.com/OpenTTD/OpenTTD
(svn r15036) -Fix: use the same value for 'random' through-out the code for PlantTree
parent
324e256dfd
commit
c666cf5a49
|
@ -213,7 +213,7 @@
|
||||||
{
|
{
|
||||||
EnforcePrecondition(false, ::IsValidTile(tile));
|
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)
|
/* static */ bool AITile::PlantTreeRectangle(TileIndex tile, uint width, uint height)
|
||||||
|
@ -223,7 +223,7 @@
|
||||||
EnforcePrecondition(false, height >= 1 && height <= 20);
|
EnforcePrecondition(false, height >= 1 && height <= 20);
|
||||||
TileIndex end_tile = tile + ::TileDiffXY(width - 1, height - 1);
|
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)
|
/* static */ bool AITile::IsWithinTownInfluence(TileIndex tile, TownID town_id)
|
||||||
|
|
|
@ -23,7 +23,7 @@ class BuildTreesWindow : public Window
|
||||||
{
|
{
|
||||||
uint16 base;
|
uint16 base;
|
||||||
uint16 count;
|
uint16 count;
|
||||||
int tree_to_plant;
|
uint tree_to_plant;
|
||||||
|
|
||||||
enum BuildTreesWidgets {
|
enum BuildTreesWidgets {
|
||||||
BTW_CLOSE,
|
BTW_CLOSE,
|
||||||
|
@ -105,7 +105,7 @@ public:
|
||||||
|
|
||||||
case BTW_TYPE_RANDOM: // tree of random type.
|
case BTW_TYPE_RANDOM: // tree of random type.
|
||||||
if (HandlePlacePushButton(this, BTW_TYPE_RANDOM, SPR_CURSOR_TREE, VHM_RECT, NULL)) {
|
if (HandlePlacePushButton(this, BTW_TYPE_RANDOM, SPR_CURSOR_TREE, VHM_RECT, NULL)) {
|
||||||
this->tree_to_plant = -1;
|
this->tree_to_plant = UINT_MAX;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue