From 10d20472d3303cdfb3ff3129bbd79f690567c41e Mon Sep 17 00:00:00 2001 From: SzwedzikPL Date: Tue, 22 Mar 2016 11:26:40 +0100 Subject: [PATCH] Remove grass behind the trench --- addons/trenches/CfgVehicles.hpp | 2 ++ addons/trenches/functions/fnc_continueDiggingTrench.sqf | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/addons/trenches/CfgVehicles.hpp b/addons/trenches/CfgVehicles.hpp index 68f4a7552a..8e1eb41fd0 100644 --- a/addons/trenches/CfgVehicles.hpp +++ b/addons/trenches/CfgVehicles.hpp @@ -61,6 +61,7 @@ class CfgVehicles { GVAR(removalDuration) = 12; GVAR(noGeoClass) = "ACE_envelope_small_NoGeo"; GVAR(placementData)[] = {2,3,0.35}; + GVAR(grassCuttingPoints)[] = {{0,-0.5,0}}; ACE_TRENCHES_ACTIONS; class EventHandlers { class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; @@ -76,6 +77,7 @@ class CfgVehicles { GVAR(removalDuration) = 15; GVAR(noGeoClass) = "ACE_envelope_big_NoGeo"; GVAR(placementData)[] = {6,1.1,0.20}; + GVAR(grassCuttingPoints)[] = {{-1.5,-1,0},{1.5,-1,0}}; ACE_TRENCHES_ACTIONS; class EventHandlers { class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; diff --git a/addons/trenches/functions/fnc_continueDiggingTrench.sqf b/addons/trenches/functions/fnc_continueDiggingTrench.sqf index 04a2377f21..223dc42df6 100644 --- a/addons/trenches/functions/fnc_continueDiggingTrench.sqf +++ b/addons/trenches/functions/fnc_continueDiggingTrench.sqf @@ -67,6 +67,15 @@ private _fnc_onFailure = { if(_actualProgress == 0) then { [_unit, _trench, _trenchId, _basePos vectorDiff [0, 0, 1.0], _vecDirAndUp, _actualProgress] call FUNC(setTrenchPlacement); + + //Remove grass + { + private _trenchGrassCutter = createVehicle ["Land_ClutterCutter_medium_F", [0, 0, 0], [], 0, "NONE"]; + private _cutterPos = AGLToASL (_trench modelToWorld _x); + _cutterPos set [2, getTerrainHeightASL _cutterPos]; + _trenchGrassCutter setPosASL _cutterPos; + deleteVehicle _trenchGrassCutter; + } foreach getArray (configFile >> "CfgVehicles" >> (typeof _trench) >> QGVAR(grassCuttingPoints)); }; private _progressLeft = (_actualProgress * 10) + 1;