--- a/src/order_cmd.cpp Thu Feb 01 16:28:11 2007 +0000
+++ b/src/order_cmd.cpp Thu Feb 01 16:48:38 2007 +0000
@@ -198,7 +198,7 @@
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;
}
--- a/src/station.cpp Thu Feb 01 16:28:11 2007 +0000
+++ b/src/station.cpp Thu Feb 01 16:48:38 2007 +0000
@@ -179,6 +179,14 @@
}
+/** 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 */
--- a/src/station.h Thu Feb 01 16:28:11 2007 +0000
+++ b/src/station.h Thu Feb 01 16:48:38 2007 +0000
@@ -161,6 +161,7 @@
void MarkDirty() const;
void MarkTilesDirty() const;
bool TileBelongsToRailStation(TileIndex tile) const;
+ bool IsBuoy() const;
protected:
static Station *AllocateRaw(void);
@@ -272,11 +273,6 @@
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 */
--- a/src/station_cmd.cpp Thu Feb 01 16:28:11 2007 +0000
+++ b/src/station_cmd.cpp Thu Feb 01 16:48:38 2007 +0000
@@ -541,7 +541,7 @@
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 @@
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.
--- a/src/vehicle_gui.cpp Thu Feb 01 16:28:11 2007 +0000
+++ b/src/vehicle_gui.cpp Thu Feb 01 16:48:38 2007 +0000
@@ -939,7 +939,7 @@
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);