R-Vaccari / bannerlord-banner-kings

BSD 3-Clause "New" or "Revised" License
72 stars 1.45k forks source link

Crash on Donating Prisoners #53

Open brandonm4 opened 2 years ago

brandonm4 commented 2 years ago

When an NPC party tries to donate prisoners and the party does not have a clan or clan leader, the game crashes. I don't think it's Bannerkings code that is causing it, I think it just happens more often because people seem to die often in Bannerkings.

I fixed it by patching DefaultPrisonerDonationModel -> "CalculateRelationGainAfterHeroPrisonerDonate" change the statement: if (!donatedHero.MapFaction.IsKingdomFaction || !donatedHero.IsFactionLeader) to if ((!donatedHero.MapFaction.IsKingdomFaction || !donatedHero.IsFactionLeader) && (donatedHero.Clan != null && donatedHero.Clan.Leader != null))

Since this is an underlying game bug and not BK I don't know if you'd want to include it in your Fixes section or not.