public static void Prefix(MechRepresentationSimGame __instance) { try { CalculatorSetup.Setup( __instance.mechDef?.Chassis, __instance.mechDef?.Inventory?.ToList()); } catch (Exception e) { Control.Logger.Error.Log(e); } }
public static void Prefix(Mech __instance) { try { var componentRefs = __instance.Weapons.Union(__instance.supportComponents) .Select(w => w.baseComponentRef as MechComponentRef) .Where(c => c != null) .ToList(); CalculatorSetup.Setup(__instance.MechDef.Chassis, componentRefs); } catch (Exception e) { Control.Logger.Error.Log(e); } }