I am attempting to update the AutoTrader mod (again) and I think I have everything fixed up, except for one error:
IEnumerable<string> locks = null; Campaign.Current.GetCampaignBehavior<IInventoryLockTracker>().GetLocks();
gives me a CS0122 error, inaccessable do to protection level.
I find the class, and it is an internal class. I have tried to dig up any changes that might have affected this but have not seen any mention of a change to this. (I think the last working version of the mod is 1.6.5).
Is there some other way I can call this? Here is the function, for reference and context:
Thanks for any help!
IEnumerable<string> locks = null; Campaign.Current.GetCampaignBehavior<IInventoryLockTracker>().GetLocks();
gives me a CS0122 error, inaccessable do to protection level.
I find the class, and it is an internal class. I have tried to dig up any changes that might have affected this but have not seen any mention of a change to this. (I think the last working version of the mod is 1.6.5).
Is there some other way I can call this? Here is the function, for reference and context:
C++:
private static void InitializeMembers()
{
AutoTraderLogic._inventoryLogic = InventoryManager.InventoryLogic;
AutoTraderLogic._isSimpleAI = AutoTraderConfig.SimpleTradingAI;
AutoTraderLogic._baseCapacity = PartyBase.MainParty.MobileParty.InventoryCapacity;
float totalWeight = PartyBase.MainParty.ItemRoster.TotalWeight;
AutoTraderLogic._availableInventoryCapacity = (int) ((double) AutoTraderLogic._baseCapacity * ((double) AutoTraderConfig.UseInventorySpaceValue / 100.0));
AutoTraderLogic._availableInventoryCapacity -= (int) totalWeight;
AutoTraderLogic._availablePlayerGold = PartyBase.MainParty.Owner.Gold - AutoTraderConfig.KeepWagesValue * PartyBase.MainParty.MobileParty.TotalWage;
switch (AutoTraderLogic._merchantType)
{
case AutoTraderLogic.MerchantType.Town:
AutoTraderLogic._availableMerchantGold = ((SettlementComponent) Settlement.CurrentSettlement.Town).Gold;
break;
case AutoTraderLogic.MerchantType.Village:
AutoTraderLogic._availableMerchantGold = ((SettlementComponent) Settlement.CurrentSettlement.Village).Gold;
break;
case AutoTraderLogic.MerchantType.Caravan:
AutoTraderLogic._availableMerchantGold = MobileParty.ConversationParty.PartyTradeGold;
break;
}
IEnumerable<string> locks = null; Campaign.Current.GetCampaignBehavior<IInventoryLockTracker>().GetLocks();
if (locks == null)
return;
AutoTraderLogic._locks = locks.ToList();
}
Thanks for any help!
