//static bool Prefix(DynamicBodyCampaignBehavior __instance, ref Dictionary<Hero, object> ____heroBehaviorsDictionary) static bool Prefix(DynamicBodyCampaignBehavior __instance) { if (!DCCSettingsUtil.Instance.IgnoreDailyTick) { return(true); } //CampaignTime deltaTime = CampaignTime.Now - SubModule.TimeSinceLastSave; CampaignTime deltaTime = SubModule.GetDeltaTime(true); double yearsElapsed = deltaTime.ToYears; //SubModule.TimeSinceLastSave = CampaignTime.Now; if (!DCCSettingsUtil.Instance.DisableAutoAging) { IDictionary dictionary = (IDictionary)AccessTools.Field(typeof(DynamicBodyCampaignBehavior), "_heroBehaviorsDictionary").GetValue(__instance); foreach (var hero in dictionary.Keys.Cast <Hero>()) { if (hero.IsHumanPlayerCharacter && DCCSettingsUtil.Instance.DebugMode) { InformationManager.DisplayMessage(new InformationMessage(DebugSetAppearanceMsg.ToString() + hero.Name, ColorManager.Red)); var test = new DynamicBodyProperties(hero.Age, hero.Weight, hero.Build); InformationManager.DisplayMessage(new InformationMessage(DebugResultMsg.ToString() + test, ColorManager.Red)); hero.BodyProperties.DynamicProperties.Equals(test); } // TODO:: Why is this conflicting now??? /*double newAge = hero.Age + yearsElapsed; * DynamicBodyProperties dynamicBodyProperties = new DynamicBodyProperties((float)newAge, hero.Weight, hero.Build);*/ DynamicBodyProperties dynamicBodyProperties = new DynamicBodyProperties(hero.Age, hero.Weight, hero.Build); BodyProperties heroBodyProperties = new BodyProperties(dynamicBodyProperties, hero.BodyProperties.StaticProperties); //BodyProperties heroBodyProperties = hero.BodyProperties; //CharacterBodyManager.CopyDynamicBodyProperties(dynamicBodyProperties, heroBodyProperties.DynamicProperties); hero.CharacterObject.UpdatePlayerCharacterBodyProperties(heroBodyProperties, hero.IsFemale); if (hero.IsHumanPlayerCharacter && DCCSettingsUtil.Instance.DebugMode) { InformationManager.DisplayMessage(new InformationMessage(SubModule.GetFormattedAgeDebugMessage(hero, hero.Age), ColorManager.Red)); } } } return(false); }