diff --git a/addons/trenches/functions/fnc_canContinueDiggingTrench.sqf b/addons/trenches/functions/fnc_canContinueDiggingTrench.sqf index 97fee957b0..740b34df7c 100644 --- a/addons/trenches/functions/fnc_canContinueDiggingTrench.sqf +++ b/addons/trenches/functions/fnc_canContinueDiggingTrench.sqf @@ -19,7 +19,7 @@ params ["_trench", "_unit"]; if !("ACE_EntrenchingTool" in (_unit call EFUNC(common,uniqueItems))) exitWith {false}; -if ((_trench getVariable [QGVAR(progress), 0]) >= 1) exitWith {false}; +if ((_trench getVariable [QGVAR(progress), 1]) >= 1) exitWith {false}; // Prevent removing/digging trench by more than one person if (_trench getVariable [QGVAR(digging), false]) exitWith {false}; diff --git a/addons/trenches/functions/fnc_continueDiggingTrench.sqf b/addons/trenches/functions/fnc_continueDiggingTrench.sqf index 6169616f2b..aee6c64ca5 100644 --- a/addons/trenches/functions/fnc_continueDiggingTrench.sqf +++ b/addons/trenches/functions/fnc_continueDiggingTrench.sqf @@ -19,7 +19,7 @@ params ["_trench", "_unit"]; TRACE_2("continueDiggingTrench",_trench,_unit); -private _actualProgress = _trench getVariable [QGVAR(progress), 0]; +private _actualProgress = _trench getVariable [QGVAR(progress), 1]; if(_actualProgress == 1) exitWith {}; // Mark trench as being worked on diff --git a/addons/trenches/functions/fnc_placeConfirm.sqf b/addons/trenches/functions/fnc_placeConfirm.sqf index 25d675d09b..867b034679 100644 --- a/addons/trenches/functions/fnc_placeConfirm.sqf +++ b/addons/trenches/functions/fnc_placeConfirm.sqf @@ -38,6 +38,7 @@ if (isNull GVAR(trench)) exitWith {}; deleteVehicle GVAR(trench); private _trench = createVehicle [GVAR(trenchClass), [0, 0, 0], [], 0, "NONE"]; +_trench setVariable [QGVAR(progress), 0, true]; GVAR(trenchPlacementData) params ["_dx", "_dy", "_offset"]; private _basePos = GVAR(trenchPos); diff --git a/addons/trenches/functions/fnc_removeTrench.sqf b/addons/trenches/functions/fnc_removeTrench.sqf index db29587a21..4340a538ad 100644 --- a/addons/trenches/functions/fnc_removeTrench.sqf +++ b/addons/trenches/functions/fnc_removeTrench.sqf @@ -19,7 +19,7 @@ params ["_trench", "_unit"]; TRACE_2("removeTrench",_trench,_unit); -private _actualProgress = _trench getVariable [QGVAR(progress), 0]; +private _actualProgress = _trench getVariable [QGVAR(progress), 1]; if(_actualProgress == 0) exitWith {}; // Mark trench as being worked on @@ -28,6 +28,9 @@ _trench setVariable [QGVAR(digging), true, true]; private _removeTime = getNumber (configFile >> "CfgVehicles" >> (typeof _trench) >> QGVAR(removalDuration)); private _removeTimeLeft = _removeTime * _actualProgress; +if (isNil {_trench getVariable QGVAR(placeData)}) then { + _trench setVariable [QGVAR(placeData), [getPosASL _trench, [vectorDir _trench, vectorUp _trench]], true]; +}; private _placeData = _trench getVariable [QGVAR(placeData), [[], []]]; _placeData params ["_basePos", "_vecDirAndUp"];