/* * The whole point of this patching is to ensure "Patch_MechStatisticsRules_CalculateTonnage" * doesn't loop when loading a stock mech. Without it a stock mech will continually check itself. * * So we mark when we're coming through this method. The first time we indicate we're in the method, * and call ourselves. When we're in the method, and called, we then return true so we actually * run the original method. Then we come back to the first method call of ourselves, and return false * so we don't loop forever. */ public static bool Prefix(LoadRequest __instance) { return(_harmonyManager.PrefixLogExceptions(() => { if (!_inFinish) { try { _inFinish = true; __instance.Finish(); } finally { _inFinish = false; } return false; } else { return true; } })); }