mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-16 05:13:58 -07:00
changed alliedEntities to entities and used updatePosition. notifyOrderFailure excludes set/unset rallypoints on allied buildings
This commit is contained in:
parent
418ec65d5d
commit
9259c2df47
3 changed files with 7 additions and 10 deletions
|
|
@ -1125,7 +1125,7 @@ var g_UnitActions =
|
|||
|
||||
Engine.PostNetworkCommand({
|
||||
"type": "set-rallypoint",
|
||||
"alliedEntities": selection,
|
||||
"entities": selection,
|
||||
"x": position.x,
|
||||
"z": position.z,
|
||||
"data": action.data,
|
||||
|
|
@ -1355,7 +1355,7 @@ var g_UnitActions =
|
|||
{
|
||||
Engine.PostNetworkCommand({
|
||||
"type": "unset-rallypoint",
|
||||
"alliedEntities": selection
|
||||
"entities": selection
|
||||
});
|
||||
|
||||
// Remove displayed rally point
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue