ai_new.c
changeset 568 b0d0df062880
parent 558 1ae2a752501e
child 679 04ca2cd69420
equal deleted inserted replaced
567:e63b977925f7 568:b0d0df062880
   609 	    	for (y = GET_TILE_Y(tile) - AI_FINDSTATION_TILE_RANGE; y <= GET_TILE_Y(tile) + AI_FINDSTATION_TILE_RANGE; y++) {
   609 	    	for (y = GET_TILE_Y(tile) - AI_FINDSTATION_TILE_RANGE; y <= GET_TILE_Y(tile) + AI_FINDSTATION_TILE_RANGE; y++) {
   610 	    		new_tile = TILE_XY(x,y);
   610 	    		new_tile = TILE_XY(x,y);
   611 	    		if (IS_TILETYPE(new_tile, MP_CLEAR) || IS_TILETYPE(new_tile, MP_TREES)) {
   611 	    		if (IS_TILETYPE(new_tile, MP_CLEAR) || IS_TILETYPE(new_tile, MP_TREES)) {
   612 	    			// This tile we can build on!
   612 	    			// This tile we can build on!
   613 	    			// Check acceptance
   613 	    			// Check acceptance
   614 	    			GetAcceptanceAroundTiles(accepts, new_tile, 1, 1);
   614 						// XXX - Get the catchment area
       
   615 	    			GetAcceptanceAroundTiles(accepts, new_tile, 1, 1, 4);
   615 	    			// >> 3 == 0 means no cargo
   616 	    			// >> 3 == 0 means no cargo
   616 	    			if (accepts[p->ainew.cargo] >> 3 == 0) continue;
   617 	    			if (accepts[p->ainew.cargo] >> 3 == 0) continue;
   617 	    			// See if we can build the station
   618 	    			// See if we can build the station
   618    	    			r = AiNew_Build_Station(p, p->ainew.tbt, new_tile, 0, 0, 0, DC_QUERY_COST);
   619    	    			r = AiNew_Build_Station(p, p->ainew.tbt, new_tile, 0, 0, 0, DC_QUERY_COST);
   619    	    			if (r == CMD_ERROR) continue;
   620    	    			if (r == CMD_ERROR) continue;