AutoVendor: find a vendor by the server's vendor bitfield #20
Loading…
Reference in a new issue
No description provided.
Delete branch "AwfulWaffle/RynthSuite:autovendor-vendor-bitfield"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Depends on: nothing (RynthSuite, based on upstream/main
7166d25).What went wrong in play
/ub vendor openby name or by id found no vendor at all. The world cache never classifies anything asAcObjectClass.Vendor(WorldObjectCachehas no Vendor arm; other code that needs to know re-derives it from the server's vendor bitfield), and AutoVendor's by-name search and its "is this a vendor" check both required that cache class. Seen on DreamWeave, where the summoned vault NPC could not be opened this way.The fix
AutoVendorManagernow recognises a vendor by the server's own vendor flag:PublicWeenieDesc._bitfieldbitBF_VENDOR(0x200,ObjectDescriptionFlag.Vendor).IsVendorObject(wo): true for the cache classVendor(should one ever be assigned), or when the engine'sTryGetObjectBitfieldreports bit 0x200. Guarded byHasGetObjectBitfieldand a try/catch, so an engine without the API behaves exactly as before.IsVendor(id)uses it, so opening by id works.IsVendorObject. The cheap name test runs before the bitfield read.How it was tested
Build (from the worktree root):
Result: Build succeeded, 0 Error(s).
Host tests (from
Tools\RynthCore.RynthAiHostTests):The one failure is
map bake: 0x6346 from the real dats ..., which needs the game dats and also fails on pristine upstream/main (baseline 1494/1495). The newVendorFlagTests(4 tests: found by name, by id, by partial name; an unflagged object is not a vendor) are registered with one line inProgram.cs.Scope and risk
3 files:
Vendor/AutoVendorManager.cs,Tests/VendorFlagTests.cs(new), and one registration line inProgram.cs. Only vendor discovery changes. Risk: any object carrying the vendor bit and matching the name is now a candidate; the nearest wins. Needs the engine'sTryGetObjectBitfield; without it, behaviour is unchanged.🤖 Generated with Claude Code
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.