tree_cmd.c
changeset 3003 821180e49591
parent 2981 ca5959cf9fc7
child 3017 a75caf4efa2d
equal deleted inserted replaced
3002:0651b917cd92 3003:821180e49591
   160 			if (!EnsureNoVehicle(tile)) continue;
   160 			if (!EnsureNoVehicle(tile)) continue;
   161 
   161 
   162 			switch (GetTileType(tile)) {
   162 			switch (GetTileType(tile)) {
   163 				case MP_TREES:
   163 				case MP_TREES:
   164 					// no more space for trees?
   164 					// no more space for trees?
   165 					if (_game_mode != GM_EDITOR && GetTreeCount(tile) != 3) {
   165 					if (_game_mode != GM_EDITOR && GetTreeCount(tile) == 3) {
   166 						_error_message = STR_2803_TREE_ALREADY_HERE;
   166 						_error_message = STR_2803_TREE_ALREADY_HERE;
   167 						continue;
   167 						continue;
   168 					}
   168 					}
   169 
   169 
   170 					if (flags & DC_EXEC) {
   170 					if (flags & DC_EXEC) {
   213 						SetTreeType(tile, treetype);
   213 						SetTreeType(tile, treetype);
   214 						SetFenceSE(tile, 0);
   214 						SetFenceSE(tile, 0);
   215 						SetFenceSW(tile, 0);
   215 						SetFenceSW(tile, 0);
   216 						SetTreeCount(tile, 0);
   216 						SetTreeCount(tile, 0);
   217 						SetTreeGrowth(tile, _game_mode == GM_EDITOR ? 3 : 0);
   217 						SetTreeGrowth(tile, _game_mode == GM_EDITOR ? 3 : 0);
       
   218 						MarkTileDirtyByTile(tile);
   218 
   219 
   219 						if (_game_mode == GM_EDITOR && IS_INT_INSIDE(treetype, TR_RAINFOREST, TR_CACTUS))
   220 						if (_game_mode == GM_EDITOR && IS_INT_INSIDE(treetype, TR_RAINFOREST, TR_CACTUS))
   220 							SetMapExtraBits(tile, 2);
   221 							SetMapExtraBits(tile, 2);
   221 					}
   222 					}
   222 					cost += _price.build_trees;
   223 					cost += _price.build_trees;