public void SetDrag(PartModule pm, DragValue DMaxMin) { ModifyingModules[pm] = DMaxMin; float Max = maximum_drag; float Min = minimum_drag; foreach (KeyValuePair<PartModule, DragValue> pair in ModifyingModules) { Max += pair.Value.maximum_drag; Min += pair.Value.minimum_drag; } part.maximum_drag = Max < 0 ? 0 : Max; part.minimum_drag = Min < 0 ? 0 : Min; }
public void SetDrag(PartModule pm, DragValue DMaxMin) { ModifyingModules[pm] = DMaxMin; float Max = maximum_drag; float Min = minimum_drag; foreach (KeyValuePair <PartModule, DragValue> pair in ModifyingModules) { Max += pair.Value.maximum_drag; Min += pair.Value.minimum_drag; } part.maximum_drag = Max < 0 ? 0 : Max; part.minimum_drag = Min < 0 ? 0 : Min; }