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; |