Exemplo n.º 1
0
        public static bool OnFinalize(Object __instance)
        {
            Type        instType       = AccessTools.TypeByName("TaleWorlds.CampaignSystem.SandBox.Issues.MerchantArmyOfPoachersIssueBehavior");
            Traverse    t              = Traverse.Create(__instance);
            MobileParty _poachersParty = t.Field("_poachersParty").GetValue <MobileParty>();

            if (_poachersParty == null)
            {
                Bannersample.Log("_poachersParty NULL!");
                return(false);
            }
            return(true);
        }
Exemplo n.º 2
0
        protected override void OnSubModuleLoad()
        {
            base.OnSubModuleLoad();
            Bannersample.Log("BannersampleSubModule.OnSubModuleLoad");

            // Null checks a method from the Army of Poachers Quest to prevent a bug fixed in 1.0.1
            // Bannersample.Prefix(
            //   "TaleWorlds.CampaignSystem.SandBox.Issues.MerchantArmyOfPoachersIssueBehavior",
            //   "MerchantArmyOfPoachersIssueQuest",
            //   "OnFinalize",
            //   "Bannersample.BannersampleSubModule",
            //   "OnFinalize"
            // );

            // Silently catches an exception occurring on formation change in a campaign siege as of 1.0.2
            // Bannersample.Finalize(
            //   "TaleWorlds.MountAndBlade.DetachmentManager",
            //   "Team_OnFormationsChanged",
            //   "Bannersample.Bannersample",
            //   "Catch"
            // );
        }
Exemplo n.º 3
0
 public override void OnGameEnd(Game game)
 {
     base.OnGameEnd(game);
     Bannersample.Log("BannersampleSubModule.OnGameEnd");
 }
Exemplo n.º 4
0
 public override void OnCampaignStart(Game game, object starterObject)
 {
     base.OnCampaignStart(game, starterObject);
     Bannersample.Log("BannersampleSubModule.OnCampaignStart");
 }
Exemplo n.º 5
0
 public static Exception Catch(Exception __exception)
 {
     Bannersample.Log(__exception.Message + " " + __exception.StackTrace);
     return(null);
 }
Exemplo n.º 6
0
 public static void Rethrow(Exception __exception)
 {
     Bannersample.Log(__exception.Message + " " + __exception.StackTrace);
     throw __exception;
 }