src/town_cmd.cpp
branchnoai
changeset 9626 79f2b5a0cdd7
parent 9625 3301b1b3889c
child 9628 b5c2449616b5
equal deleted inserted replaced
9625:3301b1b3889c 9626:79f2b5a0cdd7
  1094 	{
  1094 	{
  1095 		int32 bridge_len = GetBridgeLength(tile, tmptile);
  1095 		int32 bridge_len = GetBridgeLength(tile, tmptile);
  1096 		do {
  1096 		do {
  1097 			byte bridge_type = RandomRange(MAX_BRIDGES - 1);
  1097 			byte bridge_type = RandomRange(MAX_BRIDGES - 1);
  1098 			if (CheckBridge_Stuff(bridge_type, bridge_len)) {
  1098 			if (CheckBridge_Stuff(bridge_type, bridge_len)) {
  1099 				if (!CmdFailed(DoCommand(tile, tmptile, 0x8000 + bridge_type, DC_EXEC | DC_AUTO, CMD_BUILD_BRIDGE)))
  1099 				if (!CmdFailed(DoCommand(tile, tmptile, bridge_type | ((0x80 | ROADTYPES_ROAD) << 8), DC_EXEC | DC_AUTO, CMD_BUILD_BRIDGE)))
  1100 					_grow_town_result = -1;
  1100 					_grow_town_result = -1;
  1101 
  1101 
  1102 				/* obviously, if building any bridge would fail, there is no need to try other bridge-types */
  1102 				/* obviously, if building any bridge would fail, there is no need to try other bridge-types */
  1103 				return;
  1103 				return;
  1104 			}
  1104 			}