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!!
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!!