src/industry_cmd.cpp
changeset 7227 76ebda957d0e
parent 7216 2bb13ff061b1
child 7229 a5f262f6df1b
equal deleted inserted replaced
7226:3e15150d5a23 7227:76ebda957d0e
  1230 			if (ind_behav & INDUSTRYBEH_ONLY_INTOWN) {
  1230 			if (ind_behav & INDUSTRYBEH_ONLY_INTOWN) {
  1231 				if (!IsTileType(cur_tile, MP_HOUSE)) {
  1231 				if (!IsTileType(cur_tile, MP_HOUSE)) {
  1232 					_error_message = STR_029D_CAN_ONLY_BE_BUILT_IN_TOWNS;
  1232 					_error_message = STR_029D_CAN_ONLY_BE_BUILT_IN_TOWNS;
  1233 					return false;
  1233 					return false;
  1234 				}
  1234 				}
  1235 			}
  1235 				if (CmdFailed(DoCommand(cur_tile, 0, 0, 0, CMD_LANDSCAPE_CLEAR))) return false;
  1236 			if (ind_behav & INDUSTRYBEH_ONLY_NEARTOWN) {
  1236 			} else if ((ind_behav & INDUSTRYBEH_ONLY_NEARTOWN) == 0 || !IsTileType(cur_tile, MP_HOUSE)) {
  1237 				if (!IsTileType(cur_tile, MP_HOUSE)) goto do_clear;
  1237 				if (CmdFailed(DoCommand(cur_tile, 0, 0, DC_AUTO, CMD_LANDSCAPE_CLEAR))) return false;
  1238 			} else {
       
  1239 do_clear:
       
  1240 				if (CmdFailed(DoCommand(cur_tile, 0, 0, DC_AUTO, CMD_LANDSCAPE_CLEAR)))
       
  1241 					return false;
       
  1242 			}
  1238 			}
  1243 		}
  1239 		}
  1244 	} while ((++it)->ti.x != -0x80);
  1240 	} while ((++it)->ti.x != -0x80);
  1245 
  1241 
  1246 	return true;
  1242 	return true;