Index: binaries/data/mods/public/gui/session/unit_actions.js =================================================================== --- binaries/data/mods/public/gui/session/unit_actions.js +++ binaries/data/mods/public/gui/session/unit_actions.js @@ -50,10 +50,12 @@ "entities": selection, "x": target.x, "z": target.z, + "target": action.target, "queued": queued }); - DrawTargetMarker(target); + if (!action.target) + DrawTargetMarker(target); Engine.GuiInterfaceCall("PlaySound", { "name": "order_walk", @@ -71,7 +73,10 @@ if (!someUnitAI(selection) || !getActionInfo("move", target, selection).possible) return false; - return { "type": "move" }; + return { + "type": "move", + "target": target + }; }, "specificness": 12, }, Index: binaries/data/mods/public/simulation/helpers/Commands.js =================================================================== --- binaries/data/mods/public/simulation/helpers/Commands.js +++ binaries/data/mods/public/simulation/helpers/Commands.js @@ -156,6 +156,18 @@ "walk": function(player, cmd, data) { + if (cmd.target) + { + let cmpObstruction = Engine.QueryInterface(cmd.target, IID_Obstruction); + if (cmpObstruction && cmpObstruction.GetBlockPathfindingFlag()) + { + GetFormationUnitAIs(data.entities, player).forEach(cmpUnitAI => { + cmpUnitAI.WalkToTarget(cmd.target, cmd.queued); + }); + return; + } + } + GetFormationUnitAIs(data.entities, player).forEach(cmpUnitAI => { cmpUnitAI.Walk(cmd.x, cmd.z, cmd.queued); }); Index: source/simulation2/components/CCmpObstruction.cpp =================================================================== --- source/simulation2/components/CCmpObstruction.cpp +++ source/simulation2/components/CCmpObstruction.cpp @@ -453,6 +453,11 @@ return (m_TemplateFlags & ICmpObstructionManager::FLAG_BLOCK_MOVEMENT) != 0; } + virtual bool GetBlockPathfindingFlag() const + { + return (m_TemplateFlags & ICmpObstructionManager::FLAG_BLOCK_PATHFINDING) != 0; + } + virtual ICmpObstructionManager::tag_t GetObstruction() const { return m_Tag; Index: source/simulation2/components/ICmpObstruction.h =================================================================== --- source/simulation2/components/ICmpObstruction.h +++ source/simulation2/components/ICmpObstruction.h @@ -103,6 +103,8 @@ virtual bool GetBlockMovementFlag() const = 0; + virtual bool GetBlockPathfindingFlag() const = 0; + /** * Change the control group that the entity belongs to. * Control groups are used to let units ignore collisions with other units from Index: source/simulation2/components/ICmpObstruction.cpp =================================================================== --- source/simulation2/components/ICmpObstruction.cpp +++ source/simulation2/components/ICmpObstruction.cpp @@ -53,6 +53,7 @@ DEFINE_INTERFACE_METHOD_1("SetActive", void, ICmpObstruction, SetActive, bool) DEFINE_INTERFACE_METHOD_3("SetDisableBlockMovementPathfinding", void, ICmpObstruction, SetDisableBlockMovementPathfinding, bool, bool, int32_t) DEFINE_INTERFACE_METHOD_CONST_0("GetBlockMovementFlag", bool, ICmpObstruction, GetBlockMovementFlag) +DEFINE_INTERFACE_METHOD_CONST_0("GetBlockPathfindingFlag", bool, ICmpObstruction, GetBlockPathfindingFlag) DEFINE_INTERFACE_METHOD_1("SetControlGroup", void, ICmpObstruction, SetControlGroup, entity_id_t) DEFINE_INTERFACE_METHOD_CONST_0("GetControlGroup", entity_id_t, ICmpObstruction, GetControlGroup) DEFINE_INTERFACE_METHOD_1("SetControlGroup2", void, ICmpObstruction, SetControlGroup2, entity_id_t)