Rename the formation field to formationController

This patch renames the `unitAI.formation` field in entity states to
`unitAI.formationController` for clarity (there's `unitAI.formations`
as well, which was confusing)
This commit is contained in:
Vantha 2026-08-06 19:37:28 +02:00
parent 072ad01816
commit 60970320e3
No known key found for this signature in database
GPG key ID: 3F5D02FA4D3E8E74
3 changed files with 7 additions and 7 deletions

View file

@ -35,9 +35,9 @@ function _setMotionOverlay(ents, enabled, motionDebugOverlay, force = false)
{
resultSet.add(ent);
const entState = GetEntityState(ent);
if (entState?.unitAI?.formation)
if (entState?.unitAI?.formationController)
{
resultSet.add(entState.unitAI.formation);
resultSet.add(entState.unitAI.formationController);
}
}
@ -519,8 +519,8 @@ EntitySelection.prototype.addFormationMembers = function(entities)
for (const entity of entities)
{
const entState = GetEntityState(+entity);
if (entState?.unitAI?.formation)
for (const member of GetEntityState(+entState.unitAI.formation).formation.members)
if (entState?.unitAI?.formationController)
for (const member of GetEntityState(+entState.unitAI.formationController).formation.members)
result.add(member);
}

View file

@ -599,7 +599,7 @@ const expectedDynamicStates = {
"hasWorkOrders": true,
"isGuarding": false,
"isIdle": true,
"formation": FORMATION_CONTROLLER_ENT_ID
"formationController": FORMATION_CONTROLLER_ENT_ID
},
"visibility": "visible"
},
@ -622,7 +622,7 @@ const expectedDynamicStates = {
"hasWorkOrders": true,
"isGuarding": false,
"isIdle": true,
"formation": FORMATION_CONTROLLER_ENT_ID
"formationController": FORMATION_CONTROLLER_ENT_ID
},
"visibility": "visible"
}

View file

@ -318,7 +318,7 @@ class EntityStateRetriever
"hasWorkOrders": cmpUnitAI.HasWorkOrders(),
"isGuarding": cmpUnitAI.IsGuardOf(),
"isIdle": cmpUnitAI.IsIdle(),
"formation": cmpUnitAI.GetFormationController()
"formationController": cmpUnitAI.GetFormationController()
};
const cmpUpgrade = Engine.QueryInterface(ent, IID_Upgrade);