src/road_cmd.cpp
changeset 10236 50afe9dd466e
parent 10207 c291a21b304e
child 10260 c6ec6b3c1b18
equal deleted inserted replaced
10235:531716190738 10236:50afe9dd466e
   879 
   879 
   880 	if (!Depot::CanAllocateItem()) return CMD_ERROR;
   880 	if (!Depot::CanAllocateItem()) return CMD_ERROR;
   881 
   881 
   882 	if (flags & DC_EXEC) {
   882 	if (flags & DC_EXEC) {
   883 		Depot *dep = new Depot(tile);
   883 		Depot *dep = new Depot(tile);
   884 		dep->town_index = ClosestTownFromTile(tile, (uint)-1)->index;
   884 		dep->town_index = ClosestTownFromTile(tile, UINT_MAX)->index;
   885 
   885 
   886 		MakeRoadDepot(tile, _current_company, dir, rt);
   886 		MakeRoadDepot(tile, _current_company, dir, rt);
   887 		MarkTileDirtyByTile(tile);
   887 		MarkTileDirtyByTile(tile);
   888 	}
   888 	}
   889 	return cost.AddCost(_price.build_road_depot);
   889 	return cost.AddCost(_price.build_road_depot);
  1329 			break;
  1329 			break;
  1330 	}
  1330 	}
  1331 
  1331 
  1332 	if (IsRoadDepot(tile)) return;
  1332 	if (IsRoadDepot(tile)) return;
  1333 
  1333 
  1334 	const Town *t = ClosestTownFromTile(tile, (uint)-1);
  1334 	const Town *t = ClosestTownFromTile(tile, UINT_MAX);
  1335 	if (!HasRoadWorks(tile)) {
  1335 	if (!HasRoadWorks(tile)) {
  1336 		HouseZonesBits grp = HZB_TOWN_EDGE;
  1336 		HouseZonesBits grp = HZB_TOWN_EDGE;
  1337 
  1337 
  1338 		if (t != NULL) {
  1338 		if (t != NULL) {
  1339 			grp = GetTownRadiusGroup(t, tile);
  1339 			grp = GetTownRadiusGroup(t, tile);