Capture current mission, AI, map and administration development

Include the current addon, terrain integrations, tools, regression tests and recorded development evidence.
This commit is contained in:
2026-10-13 22:52:53 +02:00
parent a951a96edc
commit 6a667d8deb
8104 changed files with 2124945 additions and 2061 deletions
@@ -0,0 +1,43 @@
--- a/addons/core/Scripts/Game/ERR/10_AI/ERR_GroundDepotLoading.c
+++ b/addons/core/Scripts/Game/ERR/10_AI/ERR_GroundDepotLoading.c
@@ -174,18 +174,19 @@
array<IEntity> items = {}; ERR_Inventory.Items(inventory, items);
return items.Count() <= 128 && items.Contains(item);
}
- protected bool SelectWorker(ERR_HQUnit crew)
- {
- if (!Quiet(crew) || crew.HomeGuard || crew.ReservedForSupport || crew.LogisticsReservation > 0) return false;
+ protected bool SelectWorker(ERR_HQUnit crew, IEntity item)
+ {
+ if (!item || !Quiet(crew) || crew.HomeGuard || crew.ReservedForSupport || crew.LogisticsReservation > 0) return false;
if (crew.Assignment || crew.Task || crew.PendingTask || crew.PendingOrder || crew.Downlink || crew.Waypoint) return false;
int count = crew.StatusSampler.InitialStrength();
if (count < 1 || count > 32 || !crew.StatusSampler.OwnsRoster(crew.Group)) return false;
for (int slot = 0; slot < count; slot++)
{
IEntity actor = crew.StatusSampler.InitialMember(slot);
- if (!actor || !crew.StatusSampler.CanAttribute(slot, actor, false) || !ERR_Actors.CanFight(actor) || CompartmentAccessComponent.GetVehicleIn(actor)) continue;
+ if (!actor || !crew.StatusSampler.CanAttribute(slot, actor, false) || !ERR_EnemyEquipmentRules.Eligible(m_Mode, crew.Group, actor) || CompartmentAccessComponent.GetVehicleIn(actor)) continue;
SCR_ChimeraAIAgent agent = SCR_ChimeraAIAgent.Cast(SCR_AIUtils.GetAIAgent(actor));
if (!agent || !agent.m_UtilityComponent || !agent.m_UtilityComponent.m_AIInfo) continue;
+ if (!ERR_InfantryAmmoTransfer.Compatible(actor, item)) continue;
m_Worker = actor; m_WorkerSlot = slot; m_Utility = agent.m_UtilityComponent; return true;
}
return false;
@@ -211,13 +212,13 @@
// The camp is an authored own location; only the truck position is reported.
if (vector.DistanceXZ(site.Definition.Position, report.Position) > 150) continue;
ERR_HQUnit crew = m_HQ.GroundUnit(site.Responders.Group);
- if (!SelectWorker(crew)) continue;
for (int itemIndex = 0; itemIndex < m_Mode.Sites().DepotMagazineCount(site) && itemIndex < 96; itemIndex++)
{
IEntity item = m_Mode.Sites().DepotMagazine(site, itemIndex);
if (!m_Original.Contains(item) || m_Spent.Contains(item) || !ERR_GroundDepotTransfer.Magazine(item) || !Stored(item, site.Container)) continue;
- // Match a real carried rifle; source camp stock cannot become arbitrary cargo.
- if (!ERR_InfantryAmmoTransfer.Compatible(m_Worker, item)) continue;
+ // Select an original worker for this exact item; an incompatible first
+ // member must not hide a later eligible carrier of finite camp stock.
+ if (!SelectWorker(crew, item)) continue;
int token = 300000 + m_Attempts + 1;
if (!m_HQ.ReserveGroundDepot(crew, donor, service, token)) continue;
m_Reservation = new ERR_FiniteMagazineReservation(m_Original, m_Spent, item);
@@ -0,0 +1,28 @@
{
"scope": "ERR_GroundDepotLoading.c only; target and original read-only; no tests/native/compiler by author.",
"finding": "Plan selected first eligible original worker before examining item compatibility, permanently starving later compatible original members in mixed-weapon camp rosters.",
"change": [
"SelectWorker receives exact candidate item and scans at most32 original slots until both worker and compatibility qualify. Worker/slot/utility are pinned only for a matched pair.",
"Plan applies unchanged original/unspent/usable/cache custody gates before pair selection. Claims, attempt consumption and first radio order still follow successful pair selection.",
"Selection now uses ERR_EnemyEquipmentRules.Eligible instead of standalone CanFight; Eligible includes CanFight and exact current server/mode/military group/actor/player/capture checks already required by WorkerValid. This moves an existing execution prerequisite to admission rather than inventing a new restriction."
],
"preserved": [
"One global job; fixed96attempt and sourcecaps; native callback custody/quarantine and late cancellation handling.",
"Delivered report and fresh post-hold position; all quiet/combat/order/logistics claims.",
"No new item/actor, refresh, refill, deadline, radius, waypoint, movement or inventory action.",
"Per-site original stock iteration order and per-item original roster order; first compatible valid pair wins."
],
"limits": [
"Compatibility/custody are preflight only; native execution still revalidates all identities and inventories.",
"Additional bounded work can reach96items*32originalmembers per eligible camp/truck pair; existing max20services/64sites outer bounds remain. No prefix truncation or unmeasured performance claim.",
"No independent actor-position guard added: no position is read by SelectWorker and it is outside this concrete pairing defect.",
"Group-level physical ForceRecord checks remain in existing WorkerValid; not broadened in this patch.",
"No physical autonomous loading, multiplayer or frame-rate qualification."
],
"validation": {
"patch_apply_check": "passed against current successor working tree",
"actual_method_tests": "Independent hq_memory_review preparing actual SelectWorker+Plan harness; final artifact path to be supplied by peer.",
"baseline": "baseline/ retains exact current production; baseline-index/ retains exact index; source-manifest.json has before/after/patchSHA256",
"no_target_writes": true
}
}
@@ -0,0 +1,10 @@
{
"files": {
"addons/core/Scripts/Game/ERR/10_AI/ERR_GroundDepotLoading.c": {
"before_working_sha256": "36da884a833e7a29743308490a3ce5ae299f7a451d87205a227163892aca4ed0",
"before_index_sha256": "36da884a833e7a29743308490a3ce5ae299f7a451d87205a227163892aca4ed0",
"proposed_sha256": "dbc699f63d826aa6c57122483927e5092840f3fa6470f17f0acba710447b00ce"
}
},
"patch_sha256": "f130aa796c7314ffd3e50991eed985621bb5787f845ef3911935e3779784c5da"
}