mirror of https://github.com/OpenTTD/OpenTTD
(svn r2953) - Fix: [ 1257766 ] Cannot make ships go to an oil platform (oilrig has no station). While it is still possible that oilrigs end up without a station, it is only the case where no more stations can be built at all
parent
db31fe8e15
commit
7164ff86f9
|
@ -2886,15 +2886,20 @@ uint MoveGoodsToStation(TileIndex tile, int w, int h, int type, uint amount)
|
|||
|
||||
void BuildOilRig(TileIndex tile)
|
||||
{
|
||||
Station *st;
|
||||
int j;
|
||||
Station *st = AllocateStation();
|
||||
|
||||
if (st == NULL) {
|
||||
DEBUG(misc, 0) ("Couldn't allocate station for oilrig at %#X, reverting to oilrig only...", tile);
|
||||
return;
|
||||
}
|
||||
if (!GenerateStationName(st, tile, 2)) {
|
||||
DEBUG(misc, 0) ("Couldn't allocate station-name for oilrig at %#X, reverting to oilrig only...", tile);
|
||||
return;
|
||||
}
|
||||
|
||||
FOR_ALL_STATIONS(st) {
|
||||
if (st->xy == 0) {
|
||||
st->town = ClosestTownFromTile(tile, (uint)-1);
|
||||
st->sign.width_1 = 0;
|
||||
if (!GenerateStationName(st, tile, 2))
|
||||
return;
|
||||
|
||||
SetTileType(tile, MP_STATION);
|
||||
_m[tile].m5 = 0x4B;
|
||||
|
@ -2919,7 +2924,8 @@ void BuildOilRig(TileIndex tile)
|
|||
st->last_vehicle = INVALID_VEHICLE;
|
||||
st->facilities = FACIL_AIRPORT | FACIL_DOCK;
|
||||
st->build_date = _date;
|
||||
for(j=0; j!=NUM_CARGO; j++) {
|
||||
|
||||
for (j = 0; j != NUM_CARGO; j++) {
|
||||
st->goods[j].waiting_acceptance = 0;
|
||||
st->goods[j].days_since_pickup = 0;
|
||||
st->goods[j].enroute_from = INVALID_STATION;
|
||||
|
@ -2930,9 +2936,6 @@ void BuildOilRig(TileIndex tile)
|
|||
|
||||
UpdateStationVirtCoordDirty(st);
|
||||
UpdateStationAcceptance(st, false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DeleteOilRig(TileIndex tile)
|
||||
|
|
Loading…
Reference in New Issue