In Progress General Reproducable crash with musicians in taverns for cultures with a single Town only

Users who are viewing this thread

Version number
1.2.3
Branch
Beta
Modded/unmodded
Modded

hunharibo

Recruit
For mods that have custom cultures (so, like all total conversion mods) and only a single Town with that culture, then talking to a Musician in that town's tavern will always lead to a crash.

Reason: in TavernEmployeesCampaignBehavior.conversation_talk_bard_on_condition

List<string> list = new List<string>();
List<Settlement> list2 = (from x in Settlement.All
where x.IsTown && x.Culture == Settlement.CurrentSettlement.Culture && x != Settlement.CurrentSettlement
select x).ToList<Settlement>();
Settlement settlement = list2[MBRandom.RandomInt(0, list2.Count)];

There is no guard against list2 being empty.
 
Back
Top Bottom