summaryrefslogtreecommitdiff
path: root/train_cmd.c
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2006-08-27 09:28:52 +0000
committerbjarni <bjarni@openttd.org>2006-08-27 09:28:52 +0000
commit6cbd4cc167c31b71bc833449c7322b2b42d4fdfc (patch)
tree585e4dad61b4e846d7d84cbb77843c694b54e278 /train_cmd.c
parentd3096b84fdab85a0688eff8f3a6d1d2618d3162d (diff)
downloadopenttd-6cbd4cc167c31b71bc833449c7322b2b42d4fdfc.tar.xz
(svn r6165) -Feature: control click Goto Depot will now make the vehicle service
at the depot and leave right away. To tell the difference the status of stopping vehicles will be in red, while servicing vehicles will be green. -Codechange: remove some dead code in CmdSendAircraftToHangar() since it is conflicting with new functionality. Now p2 means the same for all types
Diffstat (limited to 'train_cmd.c')
-rw-r--r--train_cmd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/train_cmd.c b/train_cmd.c
index 468bcdba6..eb6c035f2 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -1924,7 +1924,7 @@ static TrainFindDepotData FindClosestTrainDepot(Vehicle *v, int max_distance)
/** Send a train to a depot
* @param tile unused
* @param p1 train to send to the depot
- * @param p2 unused
+ * @param p2 if bit 0 is set, then the train will only service at the depot. 0 Makes it stop inside
*/
int32 CmdSendTrainToDepot(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{
@@ -1960,7 +1960,8 @@ int32 CmdSendTrainToDepot(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
if (flags & DC_EXEC) {
v->dest_tile = tfdd.tile;
v->current_order.type = OT_GOTO_DEPOT;
- v->current_order.flags = OF_NON_STOP | OF_FULL_LOAD;
+ v->current_order.flags = OF_NON_STOP;
+ if (!HASBIT(p2,0)) SETBIT(v->current_order.flags, OFB_HALT_IN_DEPOT);
v->current_order.dest.depot = GetDepotByTile(tfdd.tile)->index;
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
/* If there is no depot in front, reverse automatically */