In Progress Offer of mercenary service from a now dead kingdom, leading to a crash

Users who are viewing this thread

Version number
v1.2.9.34019
Branch
Main
Modded/unmodded
No, I didn't use any mods.

TraestKF

Recruit
Summary: Each day, the game checks if the player is available for hire and looks at the previous mercenary offer.
If the kingdom that sent the previous offer has already been destroyed, this check leads to a crash

How to Reproduce: I received a mercenary offer from Battania. But within a week, Battania was destroyed. After a while, the game crashed

Unfortunately, I just closed the game and it wasn't my main campaign, but I remembered the report from BetterExceptionWindow and the circumstances.
I'm a C# coder, so I found and can point out a specific place in the code

TaleWorlds.CampaignSystem.CampaignBehaviors.VassalAndMercenaryOfferCampaignBehavior.DailyTick()
=>
TaleWorlds.CampaignSystem.CampaignBehaviors.VassalAndMercenaryOfferCampaignBehavior.MercenaryKingdomSelectionConditionsHold(Kingdom kingdom)
=>
Helpers.FactionHelper.CanPlayerOfferMercenaryService(Kingdom offerKingdom, List`1& playerWars, List`1& warsOfFactionToJoin)

The code lacks a null check for kingdom in the VassalAndMercenaryOfferCampaignBehavior.DailyTick() before checking the old mercenary offer of that kingdom by MercenaryKingdomSelectionConditionsHold(Kingdom kingdom).
If that kingdom is dead, the check leads to crash

I hope I was able to help! Thanks for a great game!!
 
Having this same issue - did you manage to fix it? I'm not really experienced with C#, but I'm looking at the code that you identified and trying to work it out!

edit: I should say I only seem to have this issue when using the Better Time mod, and I'm also running Realm of Thrones
 
Last edited:
The issue you have reported has been forwarded to our QA team for further investigation. We might need additional information regarding this issue, such as screenshots or videos, save files or dump reports. Thanks for reporting and sorry for any inconvenience!
 
Back
Top Bottom