// allow gyro upgrades to be 1 slot and still only be added once internal static void ValidateAdd( MechComponentDef newComponentDef, List <MechLabItemSlotElement> localInventory, ref string dropErrorMessage, ref bool result) { try { if (!result) { return; } if (!newComponentDef.IsGyro()) { return; } if (localInventory.Select(x => x.ComponentRef).All(x => x == null || !x.Def.IsGyro())) { return; } dropErrorMessage = String.Format("Cannot add {0}: A gyro is already installed", newComponentDef.Description.Name); result = false; } catch (Exception e) { Control.mod.Logger.LogError(e); } }