fix: remove IsSpent field declaration from perk_quick_hands hook#495
Closed
igorl-commits wants to merge 1 commit into
Closed
Conversation
BB 1.5.2.2 added IsSpent natively to perk_quick_hands. MSU's hook was declaring the same field with `<-` (new slot operator), causing a mod error on startup. Remove the declaration; the method overrides that reference this.m.IsSpent remain valid against vanilla's field. Fixes MSUTeam#494 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
BB 1.5.2.2 added
IsSpentnatively toscripts/skills/perks/perk_quick_hands. MSU's hook declares the same field with the<-(new slot) operator, causing a hard error on startup:Fix
Remove
q.m.IsSpent <- false;frommsu/hooks/skills/perks/perk_quick_hands.nut. The method overrides (isHidden,getItemActionCost,onPayForItemAction,onTurnStart) all referencethis.m.IsSpentand continue to compile against vanilla's native field.Testing
Confirmed fix resolves the startup error on BB 1.5.2.2 with MSU 1.8.0.
Analysis of the BB 1.5.2.2 bytecode (
data_001.dat) reveals that vanilla introduced more than just theIsSpentfield. Two new identifiers appear in the compiled scripts:perk_quick_hands.cnut— new method:onSpendscripts/items/item_container.cnut— callsonSpendand checksisSpent(lowercase, likely a method)This suggests vanilla now has a native item-action spending system in
item_containerthat callsonSpendon perks and checksisSpent()for availability — a parallel system to MSU'sgetItemActionCost/onPayForItemAction/isHiddenpattern.Both systems share the
IsSpentfield. The interaction is unclear from bytecode alone:isSpent()method exist natively onperk_quick_hands, or does it fall through to something else?onUpdate/onCombatStartedstub suppress any new vanilla behavior tied to the native spending system?This fix silences the startup error (which is the right minimal change), but the broader compatibility of MSU's six method overrides against vanilla's reworked quick_hands warrants a closer look by someone with access to decompiled source.
Closes #494