src/industry_cmd.cpp
branchgamebalance
changeset 9913 e79cd19772dd
parent 9912 1ac8aac92385
--- a/src/industry_cmd.cpp	Wed Jun 13 12:05:56 2007 +0000
+++ b/src/industry_cmd.cpp	Tue Jun 19 07:21:01 2007 +0000
@@ -280,6 +280,8 @@
 		if (HASBIT(_transparent_opt, TO_INDUSTRIES)) {
 			SETBIT(image, PALETTE_MODIFIER_TRANSPARENT);
 			pal = PALETTE_TO_TRANSPARENT;
+		} else if (HASBIT(image, PALETTE_MODIFIER_COLOR) && dits->building.pal == PAL_NONE) {
+			pal = GENERAL_SPRITE_COLOR(ind->random_color);
 		} else {
 			pal = dits->building.pal;
 		}
@@ -334,7 +336,7 @@
 	}
 }
 
-static int32 ClearTile_Industry(TileIndex tile, byte flags)
+static CommandCost ClearTile_Industry(TileIndex tile, byte flags)
 {
 	Industry *i = GetIndustryByTile(tile);
 	const IndustrySpec *indspec = GetIndustrySpec(i->type);
@@ -1131,6 +1133,8 @@
 			}
 		} else {
 			if (!EnsureNoVehicle(cur_tile)) return false;
+			if (MayHaveBridgeAbove(cur_tile) && IsBridgeAbove(cur_tile)) return false;
+
 			IndustyBehaviour ind_behav = GetIndustrySpec(type)->behaviour;
 
 			if (ind_behav & INDUSTRYBEH_BUILT_ONWATER) {
@@ -1465,7 +1469,7 @@
  * @param p2 unused
  * @return index of the newly create industry, or CMD_ERROR if it failed
  */
-int32 CmdBuildIndustry(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
+CommandCost CmdBuildIndustry(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
 	int num;
 	const IndustryTileTable * const *itt;