VeeArr
New member
I've once again come across an issue I've seen mentioned a few times before and had some time to do some investigation. I found that occasionally when changing equipment, mafia would lose track of my Liver Capacity modifiers and would then think I was overdrunk when I wasn't. Curiously, it doesn't seem to happen 100% consistently, but after attaching a debugger I think I narrowed down the issue to mafia sometimes incorrectly recalculating the player's current modifiers when equipping a weapon if previously unarmed.
While updating the character's status after equipping the weapon, it appears that mafia rebuilds the modifiers and accounts for passive skills by layering on a cached copy of modifiers representing the effects of those skills. For whatever reason, this set of modifiers includes the "Unarmed" boolean modifier. (I didn't check for why this is the case, though I could hypothesize that it's due to previously being unarmed and having a passive that cares about being unarmed like Master of the Surprising Fist.)
Then, when mafia tries to add the modifiers representing the passive skills to the character state, it sees that the cached skills modifiers are marked "unarmed", but the player isn't unarmed, and they get skipped. Stack for when this check occurs is listed below.
github.com
While updating the character's status after equipping the weapon, it appears that mafia rebuilds the modifiers and accounts for passive skills by layering on a cached copy of modifiers representing the effects of those skills. For whatever reason, this set of modifiers includes the "Unarmed" boolean modifier. (I didn't check for why this is the case, though I could hypothesize that it's due to previously being unarmed and having a passive that cares about being unarmed like Master of the Surprising Fist.)
Then, when mafia tries to add the modifiers representing the passive skills to the character state, it sees that the cached skills modifiers are marked "unarmed", but the player isn't unarmed, and they get skipped. Stack for when this check occurs is listed below.
kolmafia/src/net/sourceforge/kolmafia/Modifiers.java at bdb893be8f4a9a56691c2197b8e6c0a4da568c95 · kolmafia/kolmafia
KoLmafia is a cross-platform desktop tool which interfaces with the online adventure game Kingdom of Loathing 🗡️🍸 - kolmafia/kolmafia
Code:
Modifiers.add(Modifiers) line: 664
Modifiers.applyPassiveModifiers(boolean) line: 979
KoLCharacter.recalculateAdjustments(boolean, int, Map<Slot,AdventureResult>, List<AdventureResult>, FamiliarData, FamiliarData, FamiliarData, String, String, String, Map<Modeable,String>, boolean) line: 5210
KoLCharacter.recalculateAdjustments(boolean) line: 5004
KoLCharacter.recalculateAdjustments() line: 4999
CharPaneRequest.refreshEffects(JSONObject) line: 1920
CharPaneRequest.parseStatus(JSONObject) line: 1700