Files
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

74 lines
3.6 KiB
Diff

--- a/addons/core/Scripts/Game/ERR/10_AI/ERR_GroundDepotHQ.c
+++ b/addons/core/Scripts/Game/ERR/10_AI/ERR_GroundDepotHQ.c
@@ -2,8 +2,16 @@
modded class ERR_HQ
{
protected ref ERR_GroundDepotLoading m_GroundDepot;
- int GroundSupplyCount() { if (!m_Resupply) return 0; return m_Resupply.Count(); }
- ERR_InfantryResupply GroundSupplyAt(int index) { if (!m_Resupply) return null; return m_Resupply.At(index); }
+ int GroundSupplyCount()
+ {
+ if (!m_Resupply) return 0;
+ return m_Resupply.Count();
+ }
+ ERR_InfantryResupply GroundSupplyAt(int index)
+ {
+ if (!m_Resupply) return null;
+ return m_Resupply.At(index);
+ }
ERR_HQUnit GroundUnit(SCR_AIGroup group)
{
if (!group) return null;
--- a/addons/core/Scripts/Game/ERR/10_AI/ERR_InfantryResupply.c
+++ b/addons/core/Scripts/Game/ERR/10_AI/ERR_InfantryResupply.c
@@ -119,7 +119,11 @@
if (item && m_Stock.Contains(item)) committed++;
return committed > m_DepotImports;
}
- ERR_ConvoyVehicle DepotTruck() { if (!DepotCurrent()) return null; return m_Truck; }
+ ERR_ConvoyVehicle DepotTruck()
+ {
+ if (!DepotCurrent()) return null;
+ return m_Truck;
+ }
bool AdmitDepot(ERR_GroundDepotLoading job, IEntity item)
{
if (!job || !DepotAvailable() || !item || m_Stock.Contains(item) || m_Spent.Contains(item)) return false;
--- a/addons/core/Scripts/Game/ERR/10_AI/ERR_GroundDepotTransfer.c
+++ b/addons/core/Scripts/Game/ERR/10_AI/ERR_GroundDepotTransfer.c
@@ -60,7 +60,7 @@
if (!success) m_Ack = -1;
else if (m_Ack == 0) m_Ack = 1;
}
- protected bool Managed(InventoryStorageManagerComponent inventory, BaseInventoryStorageComponent storage, IEntity owner)
+ protected bool StorageManaged(InventoryStorageManagerComponent inventory, BaseInventoryStorageComponent storage, IEntity owner)
{
if (!inventory || !storage || !owner || inventory.GetOwner() != owner) return false;
if (!ERR_InfantryAmmoTransfer.StoredUnder(storage.GetOwner(), owner)) return false;
@@ -83,14 +83,14 @@
}
protected bool OriginalProof()
{
- return m_FromSlot && m_FromSlot.GetStorage() == m_FromStorage && Managed(m_Source, m_FromStorage, m_From)
+ return m_FromSlot && m_FromSlot.GetStorage() == m_FromStorage && StorageManaged(m_Source, m_FromStorage, m_From)
&& Slot(m_FromSlot) && m_Destination && m_Destination.GetOwner() == m_To
&& Contains(m_Source) == 1 && Contains(m_Destination) == 0;
}
bool PhysicalProof()
{
if (!m_Item || !m_Source || !m_From || m_Source.GetOwner() != m_From) return false;
- if (!Managed(m_Destination, m_ToStorage, m_To) || Contains(m_Source) != 0 || Contains(m_Destination) != 1) return false;
+ if (!StorageManaged(m_Destination, m_ToStorage, m_To) || Contains(m_Source) != 0 || Contains(m_Destination) != 1) return false;
InventoryItemComponent item = InventoryItemComponent.Cast(m_Item.FindComponent(InventoryItemComponent));
return item && item.GetParentSlot() && item.GetParentSlot().GetStorage() == m_ToStorage && Slot(item.GetParentSlot());
}
@@ -118,7 +118,7 @@
{
if (!m_Reservation || !OriginalProof()) { Stop(); return m_State; }
m_ToStorage = m_Destination.FindStorageForItem(m_Item, EStoragePurpose.PURPOSE_DEPOSIT);
- if (!Managed(m_Destination, m_ToStorage, m_To) || !m_Source.CanMoveItemToStorage(m_Item, m_ToStorage, -1)) { Stop(); return m_State; }
+ if (!StorageManaged(m_Destination, m_ToStorage, m_To) || !m_Source.CanMoveItemToStorage(m_Item, m_ToStorage, -1)) { Stop(); return m_State; }
if (!m_Delivery && !m_Reservation.Commit()) { Stop(); return m_State; }
if (!m_Reservation.CommittedFor(m_Item)) { Stop(); return m_State; }
if (m_Delivery && !m_Owner.ClaimDelivery(this)) { Stop(); return m_State; }