MSUTeam / MSU

Modding Standards and Utilities for Battle Brothers
21 stars 4 forks source link

fix: FatigueCost getting wrong base value during equipping weapon #394

Closed LordMidas closed 1 month ago

LordMidas commented 1 month ago

If the actor has a skill which modifies the weapon skills' FatigueCost field in e.g. onAfterUpdate function. This was happening because an update cycle happened during the call to the original addSkill, which also calls setFatigueCost and our hook on setFatigueCost was also setting the base value to the given cost. The latter is bad from a principle pov too because setting a skill's FatigueCost shouldn't modify its base fatigue cost.