| 20 | Alternative via `unit_actions.js:set-rally-point` |
| 21 | - Phabricator [[https://code.wildfiregames.com/differential/diff/21540/|diff/21540/]] |
| 22 | {{{#!diff |
| 23 | --- a/binaries/data/mods/public/gui/session/unit_actions.js |
| 24 | +++ b/binaries/data/mods/public/gui/session/unit_actions.js |
| 25 | @@ -1199,6 +1199,12 @@ var g_UnitActions = |
| 26 | data.target = targetState.id; |
| 27 | cursor = "action-repair"; |
| 28 | } |
| 29 | + else if (targetState && !targetState.identity.canDelete) |
| 30 | + { |
| 31 | + data.target = targetState.id; |
| 32 | + data.command = "capture"; |
| 33 | + cursor = "action-capture"; |
| 34 | + } |
| 35 | else if (targetState && playerCheck(entState, targetState, ["Enemy"])) |
| 36 | { |
| 37 | data.target = targetState.id; |
| 38 | --- a/binaries/data/mods/public/simulation/helpers/Commands.js |
| 39 | +++ b/binaries/data/mods/public/simulation/helpers/Commands.js |
| 40 | @@ -203,6 +203,13 @@ var g_Commands = { |
| 41 | }); |
| 42 | }, |
| 43 | |
| 44 | + "capture": function(player, cmd, data) |
| 45 | + { |
| 46 | + GetFormationUnitAIs(data.entities, player, cmd, data.formation).forEach(cmpUnitAI => { |
| 47 | + cmpUnitAI.Attack(cmd.target, true, cmd.queued, cmd.pushFront); |
| 48 | + }); |
| 49 | + }, |
| 50 | + |
| 51 | "patrol": function(player, cmd, data) |
| 52 | { |
| 53 | GetFormationUnitAIs(data.entities, player, cmd, data.formation).forEach(cmpUnitAI => |
| 54 | --- a/binaries/data/mods/public/simulation/helpers/RallyPointCommands.js |
| 55 | +++ b/binaries/data/mods/public/simulation/helpers/RallyPointCommands.js |
| 56 | @@ -102,6 +102,14 @@ function GetRallyPointCommands(cmpRallyPoint, spawnedEnts) |
| 57 | "queued": true, |
| 58 | }); |
| 59 | break; |
| 60 | + case "capture": |
| 61 | + ret.push({ |
| 62 | + "type": "capture", |
| 63 | + "entities": spawnedEnts, |
| 64 | + "target": data[i].target, |
| 65 | + "queued": true, |
| 66 | + }); |
| 67 | + break; |
| 68 | case "trade": |
| 69 | ret.push({ |
| 70 | "type": "setup-trade-route", |
| 71 | }}} |