Trenches - Add item check to progressBar (#7283)

Fix #7282
This commit is contained in:
PabstMirror 2019-11-27 09:51:22 -06:00 committed by GitHub
parent 97307769f0
commit edefaf8220
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -63,7 +63,11 @@ private _fnc_onFailure = {
// Reset animation
[_unit, "", 1] call EFUNC(common,doAnimation);
};
[(_digTimeLeft + 0.5), [_unit, _trench], _fnc_onFinish, _fnc_onFailure, localize LSTRING(DiggingTrench)] call EFUNC(common,progressBar);
private _fnc_condition = {
(_this select 0) params ["_unit"];
"ACE_EntrenchingTool" in (_unit call EFUNC(common,uniqueItems))
};
[(_digTimeLeft + 0.5), [_unit, _trench], _fnc_onFinish, _fnc_onFailure, localize LSTRING(DiggingTrench), _fnc_condition] call EFUNC(common,progressBar);
if(_actualProgress == 0) then {
[_unit, _trench, _trenchId, _basePos vectorDiff [0, 0, 1.0], _vecDirAndUp, _actualProgress] call FUNC(setTrenchPlacement);

View File

@ -61,7 +61,11 @@ private _fnc_onFailure = {
// Reset animation
[_unit, "", 1] call EFUNC(common,doAnimation);
};
[(_removeTimeLeft + 0.5), [_unit, _trench], _fnc_onFinish, _fnc_onFailure, localize LSTRING(RemovingTrench)] call EFUNC(common,progressBar);
private _fnc_condition = {
(_this select 0) params ["_unit"];
"ACE_EntrenchingTool" in (_unit call EFUNC(common,uniqueItems))
};
[(_removeTimeLeft + 0.5), [_unit, _trench], _fnc_onFinish, _fnc_onFailure, localize LSTRING(RemovingTrench), _fnc_condition] call EFUNC(common,progressBar);
private _progressLeft = ((1 - _actualProgress) * 10) + 1;