Files
EscapistsReintroduced/docs/evidence/hq-contact-reservations-2026-10-01/mounted-native-next.txt
T
jakub 6a667d8deb Capture current mission, AI, map and administration development
Include the current addon, terrain integrations, tools, regression tests and recorded development evidence.
2026-10-13 22:52:53 +02:00

24 lines
6.1 KiB
Plaintext

NEXT SINGLE NATIVE PROBE: exact mounted-magazine swap eligibility, read-only
Location and scope
[ ] Extend the existing WORKBENCH-only ERR_NativeMountedAmmoProbe at Candidate()/Fleet() after normal cargo completion, before its unrelated queued-radio-delivery wait. Existing owner: addons/core/Scripts/Game/ERR/40_Chat/ERR_NativeMountedAmmoProbe.c. Existing hook: ERR_NativeSmoke.c mounted-ammo setup/step3000; Chat --smoke mounted-ammo --rounds1, timeout>=360. Add a separately named opt-in eligibility result so it cannot be mistaken for completion of the existing radio-proof verdict. Keep fixed180-second deadline, default target3, scan<=3 existing tasks, prove at most1 selected original convoy. No legacy manually spawned convoy, forced admission, budget increase or extra inventory. Preserve hidden-run mutual exclusion/monitor/audio guards.
[ ] Use normal UnlockPrison and existing automatic fleet. Candidate already requires Ready, MagazinesIssued, exactly6 vehicles and all<=128 Cargo callbacks finished. Pin that task once; failure/loss never selects a replacement task. Vehicle[1] is the original ammo truck. Probe where the normal convoy actually exists; do not author a parking location, drive, teleport or dismount actors for this read-only slice.
Exact root/gun/magazine selection
[ ] Get original unit through existing hq.ERR_MountedFixtureUnit(vehicle.Group). Require original receipt/physical ledger, Registered&&!Released, live crew/faction, and unit.StatusSampler.ValidateBoundVehicle(vehicle.Entity). Never call BindVehicle to validate. Pick first existing armed vehicle in the same6 roots, distinct from truck; preserve exact selected root.
[ ] Discover gun/muzzle with the same<=128 accepted-descendant, character/cargo exclusion, exact installed slot normalization and deduplication rules as ERR_HQMountedAmmoSampler (<=32 weapons,<=8 muzzles/weapon). Pin original WeaponSlotComponent.GetSlotInfo()/GetWeaponEntity(), canonical physical BaseWeaponComponent, and its BaseMuzzleComponent.GetMagazine(). No manager wrapper counts as a second gun. Reject unsupported/no-loaded-magazine paths.
[ ] Pin loaded magazine entity and InventoryItemComponent.GetParentSlot(); require slot.GetParentContainer()==selected muzzle, slot.GetAttachedEntity()==loaded entity, GetStorage() exists, and storage belongs to canonical gun. Record slot.GetID(), IsLocked(), storage owner and current muzzle identity.
[ ] GetItems(PURPOSE_DEPOSIT) from original truck InventoryStorageManagerComponent, cap128, unique items. Select one actual positive compatible BaseMagazineComponent whose magazine well IsInherited(muzzle.GetMagazineWell().Type()); full original box preferable. Reject loaded/IsUsed items. Pin its parent slot, GetStorage(), GetID(), IsLocked() and attached identity; require managed truck deposit storage through GetStorages(PURPOSE_DEPOSIT) cap64 and original truck ancestry. Revalidate same identity immediately before dry call. This inventory survey alone does NOT establish membership in coordinator m_Stock or grant reservation; no Reserve/Commit during read-only probe.
Worker and geometry evidence (report separately from native API eligibility)
[ ] Inspect<=32 original members via InitialStrength/InitialMember and CanAttribute(slot,actor,false); choose an alive, fighting, same-faction original non-player worker already on foot. Validate worker belongs to donor or selected recipient original crew; never use protected player observer. Keep original drivers seated and at least one original surviving recipient occupant. The fixture's Original() requires ALL members seated, so do not reuse that predicate to approve an on-foot worker; ValidateBoundVehicle handles surviving seated attribution without first binding.
[ ] Record both native Physics velocity<=0.25 and angular velocity<=0.1. For a real worker call ERR_InfantryAmmoAccess.Clear(truck,worker), which proves authored truck cargo access. Record worker-to-canonical-gun distance<=4m. Existing code has no corresponding authored mounted loading-access predicate: do not label this distance as unobstructed mounted loading access. Missing worker/stopped state/mount-access proof is an explicit rendezvous-unqualified result; do not force movement to obtain it.
One dry native call, no transfer
[ ] Call original truck inventory.CanSwapItemStorages(exactIncoming,exactLoaded) once after identity checks; retain return bool and exact slot/owner/lock/compatibility diagnostics. Generated API: /tmp/erri-vanilla-stock/scripts/Game/generated/InventorySystem/InventoryStorageManagerComponent.c:35. Its adjacent TrySwapItemStorages(...,InventoryOperationCallback cb=null) at37 is the eventual exchange API, NOT called here. PKM authored slot provenance: /tmp/erri-horn-read/MG_PKM_mounted.et -> MG_PKM.et -> MG_PKM_base.et:17 attachments storage,253 magazine InventoryStorageSlot,256 existing100-round box template.
[ ] Immediately verify both items still occupy their original slots and muzzle still owns original loaded magazine. Log compact <=6-argument rows: original convoy/root slot, incoming/loaded identity, storage present, locked flags, well compatibility, CanSwap result, worker/stop/access gates. No TrySwap/TryMove, SetAmmoCount, spawn, deletion, reservation, radio scheduling, binding or permanent roster-release mutation.
Verdict and retained limits
[ ] TRUE CanSwap with exact slot evidence qualifies only native preflight eligibility. It proves neither a completed swap nor callbacks/replication/finite-stock reservation/physical loading/HQ demand authorization. FALSE is an actionable native refusal. No compatible finite cargo box, no convoy before deadline or no supported mounted magazine means unavailable/inconclusive, never manufacture a candidate or claim pass. All crew initially seated and random cargo can legitimately prevent a real-worker/compatible-box opportunity in180s.
[ ] Keep this result independent of original mounted radio-proof success/failure. Next actual transaction still needs shared coordinator m_Stock/m_Spent reservation, fresh delivered low-ammo demand, explicit convoy logistics exclusion, original worker access, once-only submission, two exact slot proofs and late-callback quarantine. No new native evidence has been generated while preparing this checklist.