From f200ffa90c6f3835468d5cc2ae79499b9058bd7b Mon Sep 17 00:00:00 2001 From: michi_cc Date: Fri, 4 Nov 2011 00:38:51 +0000 Subject: (svn r23087) -Feature: Auto-refitting of vehicles during loading at a station when the vehicle allows it. --- src/order_base.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/order_base.h') 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; } -- cgit v1.2.3-54-g00ecf