Repository navigation
v1.4.1-alpha — reconciliation refactor + TLK strrefs 6-8
·
296 commits
to main
since this release
This release closes two bugs and refactors the innate-grant subsystem in the process.
Fixed
- Deleting a preset left an orphan F12 innate behind (#47, reported by MrFishHead on Discord).
BfBot.Innate.Refresh's lightweight branch iterated only the config's preset list to add missing entries — it never iterated the sprite's known-innate list to remove BFBT entries whose preset had been deleted. After aDeletePreset,BFBT{slot}{deletedIdx}stayed in the F12 menu indefinitely. Rather than patch the gap with another condition, the whole innate-grant subsystem was refactored: three helpers (_HasInnate,_MaxAccumulation,_HasOrphans), the heavy/light bifurcation, and the deadGrant()function are replaced by one pure plannerBfBot.Innate._PlanReconciliation(sprite, slot, config)plus a thinRefresh(slot)orchestrator. One iterator walk diffs actual-vs-desired and either revokes-all+regrants on any mismatch (duplicate or orphan) or grants-missing-only on clean state. Self-heals legacy saves with pre-existing orphans on first load after upgrade. - Presets 6, 7, and 8 showed "Invalid: " as their F12 innate name (#48). When
MAX_PRESETSwent from 5 to 8 ina51804e, the WeiDU installer was not updated — only strrefs 1-5 were registered, and the Lua side used_baseStrref + (preset - 1)arithmetic that assumed contiguity.setup-buffbot.tp2now registers all 8 strrefs and writes each as its own line inbfbot_strrefs.txt; Lua reads them as an array indexed by preset. WeiDU does not guarantee contiguous strrefs across upgrades (existing strings keep their old strrefs while new ones get appended), so the array approach is more robust than the old arithmetic.
Internal
- Pulled an inline
AddSpecialAbilityloop out ofBfBotPer._CreateDefaultConfig(was leaking innate-grant mechanics into the persistence layer) and added asetOkguard against UDAux-write failure to prevent re-entry recursion. - New
BfBot.Test.PlanReconciliationsuite has nine cases covering nil/empty config, exact match, orphan detection, missing-desired, foreign-slot scoping,AddSpecialAbilitydedup tripwire, and end-to-end opcode-172 removal viaEEex_GameObject_ApplyEffect— synchronously verifies the cleanup mechanism removes orphans from the sprite's known-innate list (closes the gap that planner-only tests couldn't prove). - CLAUDE.md's "Innate re-grant pattern" invariant updated to describe the reconciliation shape and explicitly warn against reintroducing per-helper iterator walks.
Upgrade
Drop into your mod folder over a previous BuffBot install and run `setup-buffbot.exe` again. The first save load after upgrading will self-heal any pre-existing orphans via the new reconciliation branch.
Requires EEex v1.0.0 or later (unchanged from v1.4.0).