mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Trenches - Fix mission placed trench interactions (#7672)
Assume progress is 1 if undefined define placeData if undefined
This commit is contained in:
parent
7a8a17b924
commit
1b94b25ff6
@ -19,7 +19,7 @@
|
|||||||
params ["_trench", "_unit"];
|
params ["_trench", "_unit"];
|
||||||
|
|
||||||
if !("ACE_EntrenchingTool" in (_unit call EFUNC(common,uniqueItems))) exitWith {false};
|
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
|
// Prevent removing/digging trench by more than one person
|
||||||
if (_trench getVariable [QGVAR(digging), false]) exitWith {false};
|
if (_trench getVariable [QGVAR(digging), false]) exitWith {false};
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
params ["_trench", "_unit"];
|
params ["_trench", "_unit"];
|
||||||
TRACE_2("continueDiggingTrench",_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 {};
|
if(_actualProgress == 1) exitWith {};
|
||||||
|
|
||||||
// Mark trench as being worked on
|
// Mark trench as being worked on
|
||||||
|
@ -38,6 +38,7 @@ if (isNull GVAR(trench)) exitWith {};
|
|||||||
|
|
||||||
deleteVehicle GVAR(trench);
|
deleteVehicle GVAR(trench);
|
||||||
private _trench = createVehicle [GVAR(trenchClass), [0, 0, 0], [], 0, "NONE"];
|
private _trench = createVehicle [GVAR(trenchClass), [0, 0, 0], [], 0, "NONE"];
|
||||||
|
_trench setVariable [QGVAR(progress), 0, true];
|
||||||
|
|
||||||
GVAR(trenchPlacementData) params ["_dx", "_dy", "_offset"];
|
GVAR(trenchPlacementData) params ["_dx", "_dy", "_offset"];
|
||||||
private _basePos = GVAR(trenchPos);
|
private _basePos = GVAR(trenchPos);
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
params ["_trench", "_unit"];
|
params ["_trench", "_unit"];
|
||||||
TRACE_2("removeTrench",_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 {};
|
if(_actualProgress == 0) exitWith {};
|
||||||
|
|
||||||
// Mark trench as being worked on
|
// 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 _removeTime = getNumber (configFile >> "CfgVehicles" >> (typeof _trench) >> QGVAR(removalDuration));
|
||||||
private _removeTimeLeft = _removeTime * _actualProgress;
|
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), [[], []]];
|
private _placeData = _trench getVariable [QGVAR(placeData), [[], []]];
|
||||||
_placeData params ["_basePos", "_vecDirAndUp"];
|
_placeData params ["_basePos", "_vecDirAndUp"];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user