Resolved Crafting Order Crash Beta 1.6.0

Users who are viewing this thread

Version number
1.6.0
Branch
Beta
Modded/unmodded
Yes, but I removed mods.

Ruihan

Recruit
I looked at the stack trace of the crash
In CraftingCampaignBehavior.cs
private void GiveTroopToNobleAtWeaponTier(int tier, Hero noble)
{
CharacterObject characterObject = noble.Culture.BasicTroop;
for (int i = 0; i < tier; i++)
{
characterObject = characterObject.UpgradeTargets.GetRandomElement<CharacterObject>();
}
noble.PartyBelongedTo.AddElementToMemberRoster(characterObject, 1, false);
}
The function that get executed when you craft an item order for a noble leading a party. It gives them a troop of there culture that is upgraded the same number of times as the tier of the item you crafted for them. Weapon can be tier 6, while the standard troop caps at tier 5(4 upgrades). So crafting a tier 5 or 6 weapon cause an error when the GetRandomElement tries to get an element from an array with 0 elements (since tier 5 units have no upgrades).

Seems like a pretty easy fix if you cap tier to 4 or add a break condition in the for loop if characterObject's UpgradeTargets has a length of 0
 
Back
Top Bottom