File diff r10327:7253b31623a8 → r10328:7e960d01082d
src/train_cmd.cpp
Show inline comments
 
@@ -2080,21 +2080,19 @@ CommandCost CmdRefitRailVehicle(TileInde
 
				}
 
			}
 

	
 
			if (amount != 0) {
 
				if (new_cid != v->cargo_type) {
 
					cost.AddCost(GetRefitCost(v->engine_type));
 
				}
 

	
 
				num += amount;
 
				if (flags & DC_EXEC) {
 
					v->cargo.Truncate((v->cargo_type == new_cid) ? amount : 0);
 
					v->cargo_type = new_cid;
 
					v->cargo_cap = amount;
 
					v->cargo_subtype = new_subtype;
 
					InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
 
					InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
 
					InvalidateWindowClassesData(WC_TRAINS_LIST, 0);
 
				}
 
			if (new_cid != v->cargo_type) {
 
				cost.AddCost(GetRefitCost(v->engine_type));
 
			}
 

	
 
			num += amount;
 
			if (flags & DC_EXEC) {
 
				v->cargo.Truncate((v->cargo_type == new_cid) ? amount : 0);
 
				v->cargo_type = new_cid;
 
				v->cargo_cap = amount;
 
				v->cargo_subtype = new_subtype;
 
				InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
 
				InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
 
				InvalidateWindowClassesData(WC_TRAINS_LIST, 0);
 
			}
 
		}
 
	} while ((v = v->Next()) != NULL && !only_this);