Index: ps/trunk/binaries/data/mods/public/gui/session/input.js =================================================================== --- ps/trunk/binaries/data/mods/public/gui/session/input.js +++ ps/trunk/binaries/data/mods/public/gui/session/input.js @@ -1259,22 +1259,22 @@ return true; } -function triggerFlareAction(target) +function triggerFlareAction(position) { - let now = Date.now(); - if (g_LastFlareTime && now < g_LastFlareTime + g_FlareCooldown) - return; + let now = Date.now(); + if (g_LastFlareTime && now < g_LastFlareTime + g_FlareCooldown) + return; - g_LastFlareTime = now; - displayFlare(target, Engine.GetPlayerID()); - Engine.PlayUISound(g_FlareSound, false); - Engine.PostNetworkCommand({ - "type": "map-flare", - "target": target - }); + g_LastFlareTime = now; + displayFlare(position, Engine.GetPlayerID()); + Engine.PlayUISound(g_FlareSound, false); + Engine.PostNetworkCommand({ + "type": "map-flare", + "position": position + }); } -function handleUnitAction(target, action) +function handleUnitAction(position, action) { if (!g_UnitActions[action.type] || !g_UnitActions[action.type].execute) { @@ -1288,7 +1288,7 @@ // of running it immediately. If the pushorderfront hotkey is down, execute the order // immidiately and continue the rest of the queue afterwards. return g_UnitActions[action.type].execute( - target, + position, action, selection, Engine.HotkeyIsPressed("session.queue"), Index: ps/trunk/binaries/data/mods/public/gui/session/messages.js =================================================================== --- ps/trunk/binaries/data/mods/public/gui/session/messages.js +++ ps/trunk/binaries/data/mods/public/gui/session/messages.js @@ -305,7 +305,7 @@ } g_FlareRateLimitLastTimes.push(now); - displayFlare(notification.target, player); + displayFlare(notification.position, player); Engine.PlayUISound(g_FlareSound, false); } } Index: ps/trunk/binaries/data/mods/public/gui/session/unit_actions.js =================================================================== --- ps/trunk/binaries/data/mods/public/gui/session/unit_actions.js +++ ps/trunk/binaries/data/mods/public/gui/session/unit_actions.js @@ -51,19 +51,19 @@ { "move": { - "execute": function(target, action, selection, queued, pushFront) + "execute": function(position, action, selection, queued, pushFront) { Engine.PostNetworkCommand({ "type": "walk", "entities": selection, - "x": target.x, - "z": target.z, + "x": position.x, + "z": position.z, "queued": queued, "pushFront": pushFront, "formation": g_AutoFormation.getDefault() }); - DrawTargetMarker(target); + DrawTargetMarker(position); Engine.GuiInterfaceCall("PlaySound", { "name": "order_walk", @@ -96,7 +96,7 @@ "attack-move": { - "execute": function(target, action, selection, queued, pushFront) + "execute": function(position, action, selection, queued, pushFront) { let targetClasses; if (Engine.HotkeyIsPressed("session.attackmoveUnit")) @@ -107,8 +107,8 @@ Engine.PostNetworkCommand({ "type": "attack-walk", "entities": selection, - "x": target.x, - "z": target.z, + "x": position.x, + "z": position.z, "targetClasses": targetClasses, "queued": queued, "pushFront": pushFront, @@ -149,7 +149,7 @@ "capture": { - "execute": function(target, action, selection, queued, pushFront) + "execute": function(position, action, selection, queued, pushFront) { Engine.PostNetworkCommand({ "type": "attack", @@ -196,7 +196,7 @@ "attack": { - "execute": function(target, action, selection, queued, pushFront) + "execute": function(position, action, selection, queued, pushFront) { Engine.PostNetworkCommand({ "type": "attack", @@ -247,7 +247,7 @@ }, "call-to-arms": { - "execute": function(target, action, selection, queued, pushFront) + "execute": function(position, action, selection, queued, pushFront) { let targetClasses; if (Engine.HotkeyIsPressed("session.attackmoveUnit")) @@ -257,7 +257,7 @@ Engine.PostNetworkCommand({ "type": "call-to-arms", "entities": selection, - "target": target, + "position": position, "targetClasses": targetClasses, "queued": queued, "pushFront": pushFront, @@ -295,13 +295,13 @@ "patrol": { - "execute": function(target, action, selection, queued, pushFront) + "execute": function(position, action, selection, queued, pushFront) { Engine.PostNetworkCommand({ "type": "patrol", "entities": selection, - "x": target.x, - "z": target.z, + "x": position.x, + "z": position.z, "target": action.target, "targetClasses": { "attack": g_PatrolTargets }, "queued": queued, @@ -309,7 +309,7 @@ "formation": g_AutoFormation.getDefault() }); - DrawTargetMarker(target); + DrawTargetMarker(position); Engine.GuiInterfaceCall("PlaySound", { "name": "order_patrol", @@ -349,7 +349,7 @@ "heal": { - "execute": function(target, action, selection, queued, pushFront) + "execute": function(position, action, selection, queued, pushFront) { Engine.PostNetworkCommand({ "type": "heal", @@ -415,7 +415,7 @@ "repair": { - "execute": function(target, action, selection, queued, pushFront) + "execute": function(position, action, selection, queued, pushFront) { Engine.PostNetworkCommand({ "type": "repair", @@ -475,7 +475,7 @@ "gather": { - "execute": function(target, action, selection, queued, pushFront) + "execute": function(position, action, selection, queued, pushFront) { Engine.PostNetworkCommand({ "type": "gather", @@ -527,7 +527,7 @@ "returnresource": { - "execute": function(target, action, selection, queued, pushFront) + "execute": function(position, action, selection, queued, pushFront) { Engine.PostNetworkCommand({ "type": "returnresource", @@ -586,7 +586,7 @@ "cancel-setup-trade-route": { - "execute": function(target, action, selection, queued, pushFront) + "execute": function(position, action, selection, queued, pushFront) { Engine.PostNetworkCommand({ "type": "cancel-setup-trade-route", @@ -636,7 +636,7 @@ "setup-trade-route": { - "execute": function(target, action, selection, queued) + "execute": function(position, action, selection, queued) { Engine.PostNetworkCommand({ "type": "setup-trade-route", @@ -739,7 +739,7 @@ "occupy-turret": { - "execute": function(target, action, selection, queued, pushFront) + "execute": function(position, action, selection, queued, pushFront) { Engine.PostNetworkCommand({ "type": "occupy-turret", @@ -810,7 +810,7 @@ "garrison": { - "execute": function(target, action, selection, queued, pushFront) + "execute": function(position, action, selection, queued, pushFront) { Engine.PostNetworkCommand({ "type": "garrison", @@ -884,7 +884,7 @@ "guard": { - "execute": function(target, action, selection, queued, pushFront) + "execute": function(position, action, selection, queued, pushFront) { Engine.PostNetworkCommand({ "type": "guard", @@ -939,7 +939,7 @@ "collect-treasure": { - "execute": function(target, action, selection, queued) + "execute": function(position, action, selection, queued) { Engine.PostNetworkCommand({ "type": "collect-treasure", @@ -982,7 +982,7 @@ "remove-guard": { - "execute": function(target, action, selection, queued, pushFront) + "execute": function(position, action, selection, queued, pushFront) { Engine.PostNetworkCommand({ "type": "remove-guard", @@ -1024,18 +1024,18 @@ "set-rallypoint": { - "execute": function(target, action, selection, queued, pushFront) + "execute": function(position, action, selection, queued, pushFront) { // if there is a position set in the action then use this so that when setting a // rally point on an entity it is centered on that entity if (action.position) - target = action.position; + position = action.position; Engine.PostNetworkCommand({ "type": "set-rallypoint", "entities": selection, - "x": target.x, - "z": target.z, + "x": position.x, + "z": position.z, "data": action.data, "queued": queued }); @@ -1043,8 +1043,8 @@ // Display rally point at the new coordinates, to avoid display lag Engine.GuiInterfaceCall("DisplayRallyPoint", { "entities": selection, - "x": target.x, - "z": target.z, + "x": position.x, + "z": position.z, "queued": queued }); @@ -1248,7 +1248,7 @@ "unset-rallypoint": { - "execute": function(target, action, selection, queued, pushFront) + "execute": function(position, action, selection, queued, pushFront) { Engine.PostNetworkCommand({ "type": "unset-rallypoint", @@ -1287,7 +1287,7 @@ // when only uncontrollable entities are selected. "uncontrollable": { - "execute": function(target, action, selection, queued) + "execute": function(position, action, selection, queued) { return true; }, @@ -1312,7 +1312,7 @@ "none": { - "execute": function(target, action, selection, queued) + "execute": function(position, action, selection, queued) { return true; }, @@ -1902,15 +1902,15 @@ }); } -function displayFlare(target, playerID) +function displayFlare(position, playerID) { Engine.GuiInterfaceCall("AddTargetMarker", { "template": g_TargetMarker.map_flare, - "x": target.x, - "z": target.z, + "x": position.x, + "z": position.z, "owner": playerID }); - g_MiniMapPanel.flare(target, playerID); + g_MiniMapPanel.flare(position, playerID); } function getCommandInfo(command, entStates) Index: ps/trunk/binaries/data/mods/public/simulation/helpers/Commands.js =================================================================== --- ps/trunk/binaries/data/mods/public/simulation/helpers/Commands.js +++ ps/trunk/binaries/data/mods/public/simulation/helpers/Commands.js @@ -286,16 +286,15 @@ ["Soldier", "Warship", "Siege", "Healer"]) ); GetFormationUnitAIs(unitsToMove, player, cmd, data.formation).forEach(cmpUnitAI => { - const target = cmd.target; if (cmd.pushFront) { - cmpUnitAI.WalkAndFight(target.x, target.z, cmd.targetClasses, cmd.allowCapture, false, cmd.pushFront); + cmpUnitAI.WalkAndFight(cmd.position.x, cmd.position.z, cmd.targetClasses, cmd.allowCapture, false, cmd.pushFront); cmpUnitAI.DropAtNearestDropSite(false, cmd.pushFront); } else { cmpUnitAI.DropAtNearestDropSite(cmd.queued, false) - cmpUnitAI.WalkAndFight(target.x, target.z, cmd.targetClasses, cmd.allowCapture, true, false); + cmpUnitAI.WalkAndFight(cmd.position.x, cmd.position.z, cmd.targetClasses, cmd.allowCapture, true, false); } }); }, @@ -892,7 +891,7 @@ cmpGuiInterface.PushNotification({ "type": "map-flare", "players": [player], - "target": cmd.target + "position": cmd.position }); },