Files
EscapistsReintroduced/docs/evidence/depot-mines-2026-10-03/native-stock.patch
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

45 lines
2.3 KiB
Diff

--- a/addons/core/Scripts/Game/ERR/40_Chat/ERR_NativeSmoke.c
+++ b/addons/core/Scripts/Game/ERR/40_Chat/ERR_NativeSmoke.c
@@ -2,6 +2,33 @@
#ifdef WORKBENCH
modded class ERR_GameMode
{
+ // Read-only normal-route stock witness; no courier, movement or arming action.
+ protected bool ERR_DepotMineStockReady()
+ {
+ if (!Sites() || Sites().Count() > 64) return false;
+ int camps;
+ array<IEntity> seen = {};
+ for (int index = 0; index < Sites().Count(); index++)
+ {
+ ERR_SiteRuntime site = Sites().At(index);
+ if (!site || !site.Definition || site.Definition.Kind != ERR_LocationKind.OUTPOST || site.Definition.RevealOnEscape) continue;
+ if (!site.Container || site.DepotMines.Count() != 2) return false;
+ InventoryStorageManagerComponent inventory = InventoryStorageManagerComponent.Cast(site.Container.FindComponent(InventoryStorageManagerComponent));
+ if (!inventory || inventory.GetOwner() != site.Container) return false;
+ array<IEntity> items = {}; ERR_Inventory.Items(inventory, items);
+ if (items.Count() > 128) return false;
+ foreach (IEntity mine : site.DepotMines)
+ {
+ if (!Sites().DepotOriginal(site, mine) || !ERR_InfantryMineTransfer.ReadyMine(mine) || !items.Contains(mine)
+ || !ERR_InfantryAmmoTransfer.StoredUnder(mine, site.Container) || seen.Contains(mine)) return false;
+ seen.Insert(mine);
+ }
+ camps++;
+ }
+ PrintFormat("ERR DEPOT MINE STOCK: original camps=%1 inert stored identities=%2; no physical courier claim", camps, seen.Count());
+ return camps > 0 && seen.Count() == camps * 2;
+ }
+
protected bool m_ERRTestPatrolHQ;
protected ref ERR_NativePatrolProbe m_ERRHQPatrolMovement;
protected ref ERR_NativePatrolHQProbe m_ERRHQPatrolOrder;
@@ -837,6 +864,7 @@
string routeOutcome; System.GetCLIParam("errSmokeOutcome", routeOutcome);
if (routeOutcome == "normal-escape-route")
{
+ if (!ERR_Check(ERR_DepotMineStockReady(), "normal camps retain two original inert PMN4 mines in each cache")) return;
ERR_SiteRuntime clueSite = Sites().Find("everon-supply-1");
ERR_NativeTransportProbe maintenanceProbe = new ERR_NativeTransportProbe(this, m_ERRSmokePlayer);
if (!ERR_Check(maintenanceProbe.MaintenanceStock(clueSite), "normal Southern cache holds finite maintenance stock")) return;