Versions
Describe the bug
When an active skill is added by a weapon, but already present on the character, then the skill::add function will end very early, resulting in no setContainer call for this skill.
This scenario will cause MSU to print a logWarning with a stackstrace, that looks like this:
MSU Mod resetField("FatigueCost") skill "actives.reload_bolt" does not have base values saved.
That is because MSU only saves the base values during setContainer, but it always does a reset("FatigueCost") at the end of addSkill, no matter if the skill in question was successfullly added to the actor.
To Reproduce
Steps to reproduce the behavior: (Assumption, as I dont have a game setting without stack-based-skills, which fixes this)
- Dont use
stack-based_skills
- Create or change any weapon so that during
onEquip it adds the exact same skill twice
- Add that weapon to your inventory
- Equip that weapon
- See the log warning
Expected behavior
MSU could instead first check, if the _skill actually has a container, before calling reset("FatigueCost") on it
And then print no warning.
Or MSU prints a warning with better instructions to the modder, what they did wrong
Additional info
The mod stack-based-skills acknowledges this weird behavior and adds some glue code, so it doesn appear:
// We do this so that MSU properly saves this skill's base values
// and doesn't complain when skills added by items are not added to the actor
// thereby not having their base values saved. Because MSU tries to reset certain
// fields in its hook on weapon.addSkill.
_skill.setContainer(this);
_skill.setContainer(null);
Versions
Describe the bug
When an active skill is added by a weapon, but already present on the character, then the
skill::addfunction will end very early, resulting in nosetContainercall for this skill.This scenario will cause MSU to print a logWarning with a stackstrace, that looks like this:
That is because MSU only saves the base values during
setContainer, but it always does areset("FatigueCost")at the end ofaddSkill, no matter if the skill in question was successfullly added to the actor.To Reproduce
Steps to reproduce the behavior: (Assumption, as I dont have a game setting without stack-based-skills, which fixes this)
stack-based_skillsonEquipit adds the exact same skill twiceExpected behavior
MSU could instead first check, if the
_skillactually has a container, before callingreset("FatigueCost")on itAnd then print no warning.
Or MSU prints a warning with better instructions to the modder, what they did wrong
Additional info
The mod
stack-based-skillsacknowledges this weird behavior and adds some glue code, so it doesn appear: