summaryrefslogtreecommitdiff
path: root/src/order_base.h
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2011-11-04 00:38:51 +0000
committermichi_cc <michi_cc@openttd.org>2011-11-04 00:38:51 +0000
commitf200ffa90c6f3835468d5cc2ae79499b9058bd7b (patch)
treeb686f5dbd85948cad46307e4d64074463203d79a /src/order_base.h
parentb9841bba816d20de692e159ac6b80ddd0c202fa7 (diff)
downloadopenttd-f200ffa90c6f3835468d5cc2ae79499b9058bd7b.tar.xz
(svn r23087) -Feature: Auto-refitting of vehicles during loading at a station when the vehicle allows it.
Diffstat (limited to 'src/order_base.h')
-rw-r--r--src/order_base.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/order_base.h b/src/order_base.h
index 241e8b1b3..87d79d8a0 100644
--- a/src/order_base.h
+++ b/src/order_base.h
@@ -95,21 +95,28 @@ public:
/**
* Is this order a refit order.
- * @pre IsType(OT_GOTO_DEPOT)
+ * @pre IsType(OT_GOTO_DEPOT) || IsType(OT_GOTO_STATION)
* @return true if a refit should happen.
*/
- inline bool IsRefit() const { return this->refit_cargo < NUM_CARGO; }
+ inline bool IsRefit() const { return this->refit_cargo < NUM_CARGO || this->refit_cargo == CT_AUTO_REFIT; }
+
+ /**
+ * Is this order a auto-refit order.
+ * @pre IsType(OT_GOTO_DEPOT) || IsType(OT_GOTO_STATION)
+ * @return true if a auto-refit should happen.
+ */
+ inline bool IsAutoRefit() const { return this->refit_cargo == CT_AUTO_REFIT; }
/**
* Get the cargo to to refit to.
- * @pre IsType(OT_GOTO_DEPOT)
+ * @pre IsType(OT_GOTO_DEPOT) || IsType(OT_GOTO_STATION)
* @return the cargo type.
*/
inline CargoID GetRefitCargo() const { return this->refit_cargo; }
/**
* Get the cargo subtype to to refit to.
- * @pre IsType(OT_GOTO_DEPOT)
+ * @pre IsType(OT_GOTO_DEPOT) || IsType(OT_GOTO_STATION)
* @return the cargo subtype.
*/
inline byte GetRefitSubtype() const { return this->refit_subtype; }