Battle-Brothers-Legends / Legends-Bugs

Public bug tracker for Legends mod
35 stars 2 forks source link

[BUG] Gaining free perks on leveling up via onUpdateLevel function of a skill doesn't properly light up the perk in the perk tree IF the level was gained via XP from Training Camp #150

Closed LordMidas closed 2 years ago

LordMidas commented 2 years ago

Versions

Describe the bug In the Old Swordmaster ptr origin, when your character levels up they have a 50% chance to get a free sword perk. If the levelup happens via battle, it all works fine. If, however, I've noticed that the level-up happens via the Training Camp xp, then even though the skill is added (it shows up in a tooltip of status effect which shows free perks obtained), it doesn't light up in the perk tree. And you can actually spend your perk point on it to make it light up. However, if you spend your levelup-stats OR you pick any other perk, this perk will light up too!

Perhaps it might be a case of somehow that screen not being updated properly?

Upon saving and loading the game, then the behavior changes. The free perk you got is still not lit up, and now you can pick any perk and the free perk doesn't light up.

To Reproduce Steps to reproduce the behavior:

  1. Play the Old Swordmaster origin. Or create any skill that grants some perks upon leveling up via its onUpdateLevel function.
  2. Gain level by XP from battles. See that the gained free skill properly lights up in the perk tree.
  3. Gain level by XP from training camp. See that it doesn't light up, even though the skill has actually been given to the character.
LordMidas commented 2 years ago

Update: The bug persists even in 15.0.2.11b, and there is another facet to it. A perk which resets perks at level 11 also doesn't work properly and has weird interaction with leveling up via training camp XP. See the following message and the associated chat: https://discord.com/channels/855921501286039582/856622921010905118/949772665810456616

LordMidas commented 2 years ago

Apparently this is fixed by causing onUpdateLevel to trigger skill container update. Thanks to @NgGH707. The fix will happen in MSU.