Changeset - r6502:cd918f437a66
[Not reviewed]
master
0 4 0
maedhros - 18 years ago 2007-04-20 11:39:01
maedhros@openttd.org
(svn r9685) -Fix (r9683): Call v->LeaveStation() when a vehicle in a station is sent to a depot.
4 files changed with 9 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/aircraft_cmd.cpp
Show inline comments
 
@@ -571,6 +571,8 @@ int32 CmdSendAircraftToHangar(TileIndex 
 
		}
 

	
 
		if (flags & DC_EXEC) {
 
			if (v->current_order.type == OT_LOADING) v->LeaveStation();
 

	
 
			v->current_order.type = OT_GOTO_DEPOT;
 
			v->current_order.flags = OF_NON_STOP;
 
			if (!(p2 & DEPOT_SERVICE)) SETBIT(v->current_order.flags, OFB_HALT_IN_DEPOT);
src/roadveh_cmd.cpp
Show inline comments
 
@@ -436,6 +436,8 @@ int32 CmdSendRoadVehToDepot(TileIndex ti
 
	if (dep == NULL) return_cmd_error(STR_9019_UNABLE_TO_FIND_LOCAL_DEPOT);
 

	
 
	if (flags & DC_EXEC) {
 
		if (v->current_order.type == OT_LOADING) v->LeaveStation();
 

	
 
		ClearSlot(v);
 
		v->current_order.type = OT_GOTO_DEPOT;
 
		v->current_order.flags = OF_NON_STOP;
src/ship_cmd.cpp
Show inline comments
 
@@ -1065,6 +1065,8 @@ int32 CmdSendShipToDepot(TileIndex tile,
 
	if (dep == NULL) return_cmd_error(STR_981A_UNABLE_TO_FIND_LOCAL_DEPOT);
 

	
 
	if (flags & DC_EXEC) {
 
		if (v->current_order.type == OT_LOADING) v->LeaveStation();
 

	
 
		v->dest_tile = dep->xy;
 
		v->current_order.type = OT_GOTO_DEPOT;
 
		v->current_order.flags = OF_NON_STOP;
src/train_cmd.cpp
Show inline comments
 
@@ -1985,6 +1985,8 @@ int32 CmdSendTrainToDepot(TileIndex tile
 
	if (tfdd.best_length == (uint)-1) return_cmd_error(STR_883A_UNABLE_TO_FIND_ROUTE_TO);
 

	
 
	if (flags & DC_EXEC) {
 
		if (v->current_order.type == OT_LOADING) v->LeaveStation();
 

	
 
		v->dest_tile = tfdd.tile;
 
		v->current_order.type = OT_GOTO_DEPOT;
 
		v->current_order.flags = OF_NON_STOP;
 
@@ -1993,8 +1995,7 @@ int32 CmdSendTrainToDepot(TileIndex tile
 
		v->current_order.refit_cargo = CT_INVALID;
 
		InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
 
		/* If there is no depot in front, reverse automatically */
 
		if (tfdd.reverse)
 
			DoCommand(v->tile, v->index, 0, DC_EXEC, CMD_REVERSE_TRAIN_DIRECTION);
 
		if (tfdd.reverse) DoCommand(v->tile, v->index, 0, DC_EXEC, CMD_REVERSE_TRAIN_DIRECTION);
 
	}
 

	
 
	return 0;
0 comments (0 inline, 0 general)