summaryrefslogtreecommitdiff
path: root/src/order_base.h
diff options
context:
space:
mode:
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; }