summaryrefslogtreecommitdiff
path: root/roadveh_cmd.c
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2006-10-04 12:01:59 +0000
committerbjarni <bjarni@openttd.org>2006-10-04 12:01:59 +0000
commitf8f0bd4943cc5c6ccdcf4f9fe8dc4b03c64f6f3f (patch)
treede1248467189ac58bfefca72dc98668d05a651bf /roadveh_cmd.c
parent5bb5da02ad2f1a02462aa1d39777ec5d1d897266 (diff)
downloadopenttd-f8f0bd4943cc5c6ccdcf4f9fe8dc4b03c64f6f3f.tar.xz
(svn r6637) -Codechange: merged all (vehicle type)EnterDepot into VehicleEnterDepot()
This revealed duplicated code like aircraft lists got invalidated twice Moved invalidation of the vehicle detail window to VehicleServiceInDepot() as it should always be updated when serviced
Diffstat (limited to 'roadveh_cmd.c')
-rw-r--r--roadveh_cmd.c46
1 files changed, 0 insertions, 46 deletions
diff --git a/roadveh_cmd.c b/roadveh_cmd.c
index a38701237..f6817de62 100644
--- a/roadveh_cmd.c
+++ b/roadveh_cmd.c
@@ -1575,52 +1575,6 @@ again:
RoadZPosAffectSpeed(v, SetRoadVehPosition(v, x, y));
}
-void RoadVehEnterDepot(Vehicle *v)
-{
- v->u.road.state = 254;
- v->vehstatus |= VS_HIDDEN;
-
- InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
-
- VehicleServiceInDepot(v);
-
- TriggerVehicle(v, VEHICLE_TRIGGER_DEPOT);
-
- if (v->current_order.type == OT_GOTO_DEPOT) {
- Order t;
- int32 cost;
-
- InvalidateWindow(WC_VEHICLE_VIEW, v->index);
-
- t = v->current_order;
- 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_ROAD_VEH);
- if (!CmdFailed(cost) && v->owner == _local_player && cost != 0) ShowCostOrIncomeAnimation(v->x_pos, v->y_pos, v->z_pos, cost);
-
- // Part of the orderlist?
- if (HASBIT(t.flags, OFB_PART_OF_ORDERS)) {
- v->cur_order_index++;
- } else if (HASBIT(t.flags, OFB_HALT_IN_DEPOT)) {
- v->vehstatus |= VS_STOPPED;
- if (v->owner == _local_player) {
- SetDParam(0, v->unitnumber);
- AddNewsItem(
- STR_9016_ROAD_VEHICLE_IS_WAITING,
- NEWS_FLAGS(NM_SMALL, NF_VIEWPORT|NF_VEHICLE, NT_ADVICE, 0),
- v->index,
- 0
- );
- }
- }
- }
-
- InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
- InvalidateWindowClasses(WC_ROADVEH_LIST);
-}
-
static void AgeRoadVehCargo(Vehicle *v)
{
if (_age_cargo_skip_counter != 0) return;