diff options
Diffstat (limited to 'train_cmd.c')
-rw-r--r-- | train_cmd.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/train_cmd.c b/train_cmd.c index 5c1ce0eb7..5c1abe6ae 100644 --- a/train_cmd.c +++ b/train_cmd.c @@ -3494,6 +3494,7 @@ void TrainEnterDepot(Vehicle *v, TileIndex tile) if (v->current_order.type == OT_GOTO_DEPOT) { Order t; + int32 cost; InvalidateWindow(WC_VEHICLE_VIEW, v->index); @@ -3501,6 +3502,10 @@ void TrainEnterDepot(Vehicle *v, TileIndex tile) v->current_order.type = OT_DUMMY; v->current_order.flags = 0; + _current_player = v->owner; + cost = DoCommand(v->tile, v->index, t.refit_cargo | t.refit_subtype << 8, DC_EXEC, CMD_REFIT_RAIL_VEHICLE); + if (!CmdFailed(cost) && v->owner == _local_player && cost != 0) ShowCostOrIncomeAnimation(v->x_pos, v->y_pos, v->z_pos, cost); + if (HASBIT(t.flags, OFB_PART_OF_ORDERS)) { // Part of the orderlist? v->u.rail.days_since_order_progr = 0; v->cur_order_index++; |