diff options
-rw-r--r-- | src/order_cmd.cpp | 2 | ||||
-rw-r--r-- | src/station.cpp | 8 | ||||
-rw-r--r-- | src/station.h | 6 | ||||
-rw-r--r-- | src/station_cmd.cpp | 4 | ||||
-rw-r--r-- | src/vehicle_gui.cpp | 2 |
5 files changed, 13 insertions, 9 deletions
diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index 826f3584d..8b6fb7e50 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -198,7 +198,7 @@ int32 CmdInsertOrder(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) if (!IsValidStationID(new_order.dest)) return CMD_ERROR; st = GetStation(new_order.dest); - if (st->airport_type != AT_OILRIG && !IsBuoy(st) && !CheckOwnership(st->owner)) { + if (st->airport_type != AT_OILRIG && !st->IsBuoy() && !CheckOwnership(st->owner)) { return CMD_ERROR; } diff --git a/src/station.cpp b/src/station.cpp index 7998e49ca..c9dc3a9f7 100644 --- a/src/station.cpp +++ b/src/station.cpp @@ -179,6 +179,14 @@ bool Station::TileBelongsToRailStation(TileIndex tile) const } +/** Determines whether a station is a buoy only. + * @todo Ditch this encoding of buoys + */ +bool Station::IsBuoy() const +{ + return (this->had_vehicle_of_type & HVOT_BUOY) != 0; +} + /************************************************************************/ /* StationRect implementation */ diff --git a/src/station.h b/src/station.h index 8000bee91..c278a8abe 100644 --- a/src/station.h +++ b/src/station.h @@ -161,6 +161,7 @@ struct Station { void MarkDirty() const; void MarkTilesDirty() const; bool TileBelongsToRailStation(TileIndex tile) const; + bool IsBuoy() const; protected: static Station *AllocateRaw(void); @@ -272,11 +273,6 @@ uint GetNumRoadStops(const Station* st, RoadStop::Type type); RoadStop * AllocateRoadStop( void ); void ClearSlot(Vehicle *v); -static inline bool IsBuoy(const Station* st) -{ - return (st->had_vehicle_of_type & HVOT_BUOY) != 0; /* XXX: We should really ditch this ugly coding and switch to something sane... */ -} - void DeleteOilRig(TileIndex t); #endif /* STATION_H */ diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 7d3f7dbb9..ecc8b9148 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -541,7 +541,7 @@ static void UpdateStationAcceptance(Station *st, bool show_msg) rect.min_y = MapSizeY(); rect.max_x = rect.max_y = 0; // Don't update acceptance for a buoy - if (IsBuoy(st)) return; + if (st->IsBuoy()) return; /* old accepted goods types */ old_acc = GetAcceptanceMask(st); @@ -2545,7 +2545,7 @@ uint MoveGoodsToStation(TileIndex tile, int w, int h, int type, uint amount) for (i = 0; i != lengthof(around); i++) { if (around[i] == NULL) { - if (!IsBuoy(st) && + if (!st->IsBuoy() && (st->town->exclusive_counter == 0 || st->town->exclusivity == st->owner) && // check exclusive transport rights st->goods[type].rating != 0 && (!_patches.selectgoods || st->goods[type].last_speed > 0) && // if last_speed is 0, no vehicle has been there. diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 22dced73e..9ee47a19b 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -939,7 +939,7 @@ static void DrawSmallOrderList(const Vehicle *v, int x, int y) sel--; if (order->type == OT_GOTO_STATION) { - if (v->type == VEH_Ship && IsBuoy(GetStation(order->dest))) continue; + if (v->type == VEH_Ship && GetStation(order->dest)->IsBuoy()) continue; SetDParam(0, order->dest); DrawString(x, y, STR_A036, 0); |