train_cmd.c
changeset 1842 7efaede8ac8e
parent 1802 448f187042d3
child 1859 b3af0081df39
equal deleted inserted replaced
1841:b41b821d9a23 1842:7efaede8ac8e
   930 	first = GetFirstVehicleInChain(v);
   930 	first = GetFirstVehicleInChain(v);
   931 
   931 
   932 	// make sure the vehicle is stopped in the depot
   932 	// make sure the vehicle is stopped in the depot
   933 	if (CheckTrainStoppedInDepot(first) < 0) return CMD_ERROR;
   933 	if (CheckTrainStoppedInDepot(first) < 0) return CMD_ERROR;
   934 
   934 
   935 	if ((flags & DC_EXEC) && v == first && first->subtype == TS_Front_Engine) {
   935 	if (flags & DC_EXEC) {
   936 		DeleteWindowById(WC_VEHICLE_VIEW, first->index);
   936 		if (v == first && first->subtype == TS_Front_Engine) {
   937 		InvalidateWindow(WC_REPLACE_VEHICLE, VEH_Train);
   937 			DeleteWindowById(WC_VEHICLE_VIEW, first->index);
       
   938 			InvalidateWindow(WC_REPLACE_VEHICLE, VEH_Train);
       
   939 		}
   938 		InvalidateWindow(WC_VEHICLE_DEPOT, first->tile);
   940 		InvalidateWindow(WC_VEHICLE_DEPOT, first->tile);
   939 		RebuildVehicleLists();
   941 		RebuildVehicleLists();
   940 	}
   942 	}
   941 
   943 
   942 	switch (p2) {
   944 	switch (p2) {