ai_build.c
changeset 900 27eb21ced433
parent 679 04ca2cd69420
child 1035 812f837ee03f
equal deleted inserted replaced
899:69db9cb6bc9d 900:27eb21ced433
   248     	return DoCommandByTile(tile, 0, direction, flag | DC_AUTO | DC_NO_WATER, CMD_BUILD_TRAIN_DEPOT);
   248     	return DoCommandByTile(tile, 0, direction, flag | DC_AUTO | DC_NO_WATER, CMD_BUILD_TRAIN_DEPOT);
   249     } else {
   249     } else {
   250     	r = DoCommandByTile(tile, direction, 0, flag | DC_AUTO | DC_NO_WATER, CMD_BUILD_ROAD_DEPOT);
   250     	r = DoCommandByTile(tile, direction, 0, flag | DC_AUTO | DC_NO_WATER, CMD_BUILD_ROAD_DEPOT);
   251     	if (r == CMD_ERROR) return r;
   251     	if (r == CMD_ERROR) return r;
   252     	// Try to build the road from the depot
   252     	// Try to build the road from the depot
   253     	r2 = DoCommandByTile(tile + _tileoffs_by_dir[direction], _roadbits_by_dir[direction], 0, flag | DC_AUTO | DC_NO_WATER, CMD_BUILD_ROAD);
   253     	r2 = DoCommandByTile(tile + TileOffsByDir(direction), _roadbits_by_dir[direction], 0, flag | DC_AUTO | DC_NO_WATER, CMD_BUILD_ROAD);
   254     	// If it fails, ignore it..
   254     	// If it fails, ignore it..
   255     	if (r2 == CMD_ERROR) return r;
   255     	if (r2 == CMD_ERROR) return r;
   256     	return r + r2;
   256     	return r + r2;
   257     }
   257     }
   258 }
   258 }