Resolved No mercenary leave option (C# code fix included!)

Users who are viewing this thread

Summary:
When in mercenary service for a faction, the conversation option to terminate the contract does not show up.

Reproduce:
Become a mercenary, then talk to any lord of the corresponding faction. Use "There's something I'd like to discuss". There is no leaving option, which there should be.

Fix:
In the following method the first condition of the return statement is wrong, Clan.IsKingdomFaction ALWAYS returns false because its purpose is to differentiate between a Clan IFaction and a Kingdom IFaction.
C#:
public bool conversation_player_want_to_end_service_as_mercenary_on_condition()
        {
            if (Hero.OneToOneConversationHero.MapFaction.IsKingdomFaction)
            {
                MBTextManager.SetTextVariable("FACTION_NAME", FactionHelper.GetFormalNameForFaction(Hero.OneToOneConversationHero.Clan.Kingdom), false);
            }
            return Hero.OneToOneConversationHero.Clan.IsKingdomFaction && Hero.MainHero.MapFaction == Hero.OneToOneConversationHero.MapFaction && Hero.OneToOneConversationHero.Clan != Hero.MainHero.Clan && Hero.MainHero.Clan.IsUnderMercenaryService;
        }

The dev probably meant to check if the Clan is part of a Kingdom, which is done in the following manner (note the ! to invert the result):
!Hero.OneToOneConversationHero.Clan.IsMapFaction

Clan.IsMapFaction uses return this._kingdom == null;, so if the Clan has no Kingdom the property returns true.

The correct return function of public bool conversation_player_want_to_end_service_as_mercenary_on_condition() should thus look like this:
C#:
return !Hero.OneToOneConversationHero.Clan.IsMapFaction && Hero.MainHero.MapFaction == Hero.OneToOneConversationHero.MapFaction && Hero.OneToOneConversationHero.Clan != Hero.MainHero.Clan && Hero.MainHero.Clan.IsUnderMercenaryService;

Tested and confirmed by yours truly.
 
By design that option might have been limited to the faction leaders. I will be forwarding this issue to our QA team but if our design is not like this, I highly doubt this will change. Thanks for reporting.
 
By design that option might have been limited to the faction leaders. I will be forwarding this issue to our QA team but if our design is not like this, I highly doubt this will change. Thanks for reporting.

If so, then the code is still wrong, because the condition currently used will also return false with faction leaders. There is no way this option can ever show up as it is now. Lots of players have confirmed this all over the forum.

This is the code of the Clan.IsKingdomFaction property, it returns false by definition:

C#:
public bool IsKingdomFaction
        {
            get
            {
                return false;
            }
        }
 
Last edited:
Back
Top Bottom