src/tree_cmd.cpp
branchgamebalance
changeset 9913 e79cd19772dd
parent 9912 1ac8aac92385
equal deleted inserted replaced
9912:1ac8aac92385 9913:e79cd19772dd
   211  * @param tile start tile of area-drag of tree plantation
   211  * @param tile start tile of area-drag of tree plantation
   212  * @param flags type of operation
   212  * @param flags type of operation
   213  * @param p1 tree type, -1 means random.
   213  * @param p1 tree type, -1 means random.
   214  * @param p2 end tile of area-drag
   214  * @param p2 end tile of area-drag
   215  */
   215  */
   216 int32 CmdPlantTree(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
   216 CommandCost CmdPlantTree(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
   217 {
   217 {
   218 	StringID msg = INVALID_STRING_ID;
   218 	StringID msg = INVALID_STRING_ID;
   219 	int32 cost;
   219 	CommandCost cost;
   220 	int ex;
   220 	int ex;
   221 	int ey;
   221 	int ey;
   222 	int sx, sy, x, y;
   222 	int sx, sy, x, y;
   223 
   223 
   224 	if (p2 >= MapSize()) return CMD_ERROR;
   224 	if (p2 >= MapSize()) return CMD_ERROR;
   426 static Slope GetSlopeTileh_Trees(TileIndex tile, Slope tileh)
   426 static Slope GetSlopeTileh_Trees(TileIndex tile, Slope tileh)
   427 {
   427 {
   428 	return tileh;
   428 	return tileh;
   429 }
   429 }
   430 
   430 
   431 static int32 ClearTile_Trees(TileIndex tile, byte flags)
   431 static CommandCost ClearTile_Trees(TileIndex tile, byte flags)
   432 {
   432 {
   433 	uint num;
   433 	uint num;
   434 
   434 
   435 	if ((flags & DC_EXEC) && IsValidPlayer(_current_player)) {
   435 	if ((flags & DC_EXEC) && IsValidPlayer(_current_player)) {
   436 		Town *t = ClosestTownFromTile(tile, _patches.dist_local_authority);
   436 		Town *t = ClosestTownFromTile(tile, _patches.dist_local_authority);