train_cmd.c
changeset 1842 fb9086b04740
parent 1802 da61740cc1e7
child 1859 870dcb6fd65b
equal deleted inserted replaced
1841:1f3f4039dc85 1842:fb9086b04740
   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) {