changed alliedEntities to entities and used updatePosition. notifyOrderFailure excludes set/unset rallypoints on allied buildings

This commit is contained in:
mehmed-faheim-arslan 2026-05-18 17:53:33 +01:00
parent 1fae36f996
commit ebd2cab618
3 changed files with 7 additions and 10 deletions

View file

@ -1120,7 +1120,7 @@ var g_UnitActions =
Engine.PostNetworkCommand({
"type": "set-rallypoint",
"alliedEntities": selection,
"entities": selection,
"x": position.x,
"z": position.z,
"data": action.data,
@ -1348,7 +1348,7 @@ var g_UnitActions =
{
Engine.PostNetworkCommand({
"type": "unset-rallypoint",
"alliedEntities": selection
"entities": selection
});
// Remove displayed rally point

View file

@ -1131,13 +1131,10 @@ GuiInterface.prototype.OnUpdate = function()
continue;
const positions = cmpRallyPoint.GetPositions(player);
if (!positions.length)
continue;
// Update renderer positions so the path follows moving targets.
cmpRallyPointRenderer.SetPosition(new Vector2D(positions[0].x, positions[0].z));
for (let i = 1; i < positions.length; i++)
cmpRallyPointRenderer.AddPosition(new Vector2D(positions[i].x, positions[i].z));
for (let i = 0; i < positions.length; i++)
cmpRallyPointRenderer.UpdatePosition(i, new Vector2D(positions[i].x, positions[i].z));
}
};

View file

@ -434,7 +434,7 @@ var g_Commands = {
"set-rallypoint": function(player, cmd, data)
{
for (const ent of (cmd.alliedEntities || []))
for (const ent of (cmd.entities || []))
{
if (!IsOwnedByPlayerOrMutualAlly(ent, player))
continue;
@ -453,7 +453,7 @@ var g_Commands = {
"unset-rallypoint": function(player, cmd, data)
{
for (const ent of (cmd.alliedEntities || []))
for (const ent of (cmd.entities || []))
{
if (!IsOwnedByPlayerOrMutualAlly(ent, player))
continue;
@ -925,7 +925,7 @@ function ProcessCommand(player, cmd)
"controlAllUnits": cmpPlayer.CanControlAllUnits()
};
if (cmd.entities)
if (cmd.entities && cmd.type !== "set-rallypoint" && cmd.type !== "unset-rallypoint")
data.entities = FilterEntityList(cmd.entities, player, data.controlAllUnits);
// TODO: queuing order and forcing formations doesn't really work.