renamed set/unset-rallypoint cmd field to structures, use structures instead of entities in rally point commands

This commit is contained in:
mehmed-faheim-arslan 2026-05-25 20:32:48 +01:00
parent db8f374a9f
commit 29087fd9fa
3 changed files with 7 additions and 7 deletions

View file

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

View file

@ -996,13 +996,13 @@ export const Entity = Class({
"setRallyPoint": function(target, command)
{
const data = { "command": command, "target": target.id() };
Engine.PostCommand(PlayerID, { "type": "set-rallypoint", "entities": [this.id()], "x": target.position()[0], "z": target.position()[1], "data": data });
Engine.PostCommand(PlayerID, { "type": "set-rallypoint", "structures": [this.id()], "x": target.position()[0], "z": target.position()[1], "data": data });
return this;
},
"unsetRallyPoint": function()
{
Engine.PostCommand(PlayerID, { "type": "unset-rallypoint", "entities": [this.id()] });
Engine.PostCommand(PlayerID, { "type": "unset-rallypoint", "structures": [this.id()] });
return this;
},

View file

@ -434,7 +434,7 @@ var g_Commands = {
"set-rallypoint": function(player, cmd, data)
{
const structures = FilterEntityListWithAllies(cmd.entities || [], player, data.controlAllUnits);
const structures = FilterEntityListWithAllies(cmd.structures || [], player, data.controlAllUnits);
for (const structure of structures)
{
const cmpRallyPoint = Engine.QueryInterface(structure, IID_RallyPoint);
@ -451,7 +451,7 @@ var g_Commands = {
"unset-rallypoint": function(player, cmd, data)
{
const structures = FilterEntityListWithAllies(cmd.entities || [], player, data.controlAllUnits);
const structures = FilterEntityListWithAllies(cmd.structures || [], player, data.controlAllUnits);
for (const structure of structures)
{
const cmpRallyPoint = Engine.QueryInterface(structure, IID_RallyPoint);
@ -921,7 +921,7 @@ function ProcessCommand(player, cmd)
"controlAllUnits": cmpPlayer.CanControlAllUnits()
};
if (cmd.entities && cmd.type !== "set-rallypoint" && cmd.type !== "unset-rallypoint")
if (cmd.entities)
data.entities = FilterEntityList(cmd.entities, player, data.controlAllUnits);
// TODO: queuing order and forcing formations doesn't really work.