tunnelbridge_cmd.c
changeset 2737 fb1556b8f5e0
parent 2676 59b65b4fb480
child 2763 a4d065e3261b
equal deleted inserted replaced
2736:3d6487cbbb69 2737:fb1556b8f5e0
   277 		return CMD_ERROR;
   277 		return CMD_ERROR;
   278 	cost = ret;
   278 	cost = ret;
   279 
   279 
   280 	// true - bridge-start-tile, false - bridge-end-tile
   280 	// true - bridge-start-tile, false - bridge-end-tile
   281 	terraformcost = CheckBridgeSlope(direction, ti_start.tileh, true);
   281 	terraformcost = CheckBridgeSlope(direction, ti_start.tileh, true);
   282 	if (terraformcost == CMD_ERROR || (terraformcost && !allow_on_slopes))
   282 	if (CmdFailed(terraformcost) || (terraformcost && !allow_on_slopes))
   283 		return_cmd_error(STR_1000_LAND_SLOPED_IN_WRONG_DIRECTION);
   283 		return_cmd_error(STR_1000_LAND_SLOPED_IN_WRONG_DIRECTION);
   284 	cost += terraformcost;
   284 	cost += terraformcost;
   285 
   285 
   286 	/* Try and clear the end landscape */
   286 	/* Try and clear the end landscape */
   287 
   287 
   289 	if (CmdFailed(ret)) return CMD_ERROR;
   289 	if (CmdFailed(ret)) return CMD_ERROR;
   290 	cost += ret;
   290 	cost += ret;
   291 
   291 
   292 	// false - end tile slope check
   292 	// false - end tile slope check
   293 	terraformcost = CheckBridgeSlope(direction, ti_end.tileh, false);
   293 	terraformcost = CheckBridgeSlope(direction, ti_end.tileh, false);
   294 	if (terraformcost == CMD_ERROR || (terraformcost && !allow_on_slopes))
   294 	if (CmdFailed(terraformcost) || (terraformcost && !allow_on_slopes))
   295 		return_cmd_error(STR_1000_LAND_SLOPED_IN_WRONG_DIRECTION);
   295 		return_cmd_error(STR_1000_LAND_SLOPED_IN_WRONG_DIRECTION);
   296 	cost += terraformcost;
   296 	cost += terraformcost;
   297 
   297 
   298 
   298 
   299 	/* do the drill? */
   299 	/* do the drill? */