diff --git a/addons/trenches/CfgVehicles.hpp b/addons/trenches/CfgVehicles.hpp index 27875273916..108dcc39707 100644 --- a/addons/trenches/CfgVehicles.hpp +++ b/addons/trenches/CfgVehicles.hpp @@ -59,7 +59,6 @@ class CfgVehicles { GVAR(removalDuration) = QGVAR(smallEnvelopeRemovalTime); GVAR(placementData)[] = {2,3,0.35}; GVAR(grassCuttingPoints)[] = {{0,-0.5,0}}; - GVAR(boundingBoxOffset) = 0.16; editorCategory = "EdCat_Things"; editorSubcategory = "EdSubcat_Military"; @@ -136,7 +135,6 @@ class CfgVehicles { GVAR(removalDuration) = QGVAR(bigEnvelopeRemovalTime); GVAR(placementData)[] = {6,1.1,0.20}; GVAR(grassCuttingPoints)[] = {{-1.5,-1,0},{1.5,-1,0}}; - GVAR(boundingBoxOffset) = 0.197; class GVAR(camouflagePositions) { center[] = {-0.4, 0.4, 0.2}; @@ -152,7 +150,6 @@ class CfgVehicles { GVAR(placementData)[] = {15,1.1,0.40}; GVAR(grassCuttingPoints)[] = {{-1.5,-1,0},{1.5,-1,0}}; model = QPATHTOF(data\trench_huge.p3d); - GVAR(boundingBoxOffset) = 0.557; class GVAR(camouflagePositions) { left1[] = {-0.5, 0.3, 0.5}; @@ -169,7 +166,6 @@ class CfgVehicles { GVAR(placementData)[] = {6,1.1,0.20}; GVAR(grassCuttingPoints)[] = {{-1.5,-1,0},{1.5,-1,0}}; model = QPATHTOF(data\trench_vehicle.p3d); - GVAR(boundingBoxOffset) = 0.34; class GVAR(camouflagePositions) {}; class Attributes {}; @@ -183,7 +179,6 @@ class CfgVehicles { GVAR(placementData)[] = {10,1.1,0.20}; GVAR(grassCuttingPoints)[] = {{-1.5,-1,0},{1.5,-1,0}}; model = QPATHTOF(data\trench_short.p3d); - GVAR(boundingBoxOffset) = 0.16; class GVAR(camouflagePositions) { right[] = {1.1,0.2,0.2}; diff --git a/addons/trenches/data/trench_big.p3d b/addons/trenches/data/trench_big.p3d index 40f57f0844c..c0b1703af4e 100644 Binary files a/addons/trenches/data/trench_big.p3d and b/addons/trenches/data/trench_big.p3d differ diff --git a/addons/trenches/data/trench_huge.p3d b/addons/trenches/data/trench_huge.p3d index 4935b26d892..e77e25518e7 100644 Binary files a/addons/trenches/data/trench_huge.p3d and b/addons/trenches/data/trench_huge.p3d differ diff --git a/addons/trenches/data/trench_short.p3d b/addons/trenches/data/trench_short.p3d index 44732a209de..e9716964242 100644 Binary files a/addons/trenches/data/trench_short.p3d and b/addons/trenches/data/trench_short.p3d differ diff --git a/addons/trenches/data/trench_small.p3d b/addons/trenches/data/trench_small.p3d index 04144634b33..01ba2856807 100644 Binary files a/addons/trenches/data/trench_small.p3d and b/addons/trenches/data/trench_small.p3d differ diff --git a/addons/trenches/data/trench_vehicle.p3d b/addons/trenches/data/trench_vehicle.p3d index 98a10618198..584f568df75 100644 Binary files a/addons/trenches/data/trench_vehicle.p3d and b/addons/trenches/data/trench_vehicle.p3d differ diff --git a/addons/trenches/functions/fnc_continueDiggingTrench.sqf b/addons/trenches/functions/fnc_continueDiggingTrench.sqf index 156fa9126e4..c2a3778b4b2 100644 --- a/addons/trenches/functions/fnc_continueDiggingTrench.sqf +++ b/addons/trenches/functions/fnc_continueDiggingTrench.sqf @@ -114,9 +114,8 @@ if (_actualProgress == 0) then { _lbfc params ["", "", "_lbfcZ"]; private _pos = getPosWorld _trench; - private _posDiff = ((abs((_trench getVariable [QGVAR(diggingSteps), 0]) + _lbfcZ)) * _diggerCount)/(_digTime*5); + private _posDiff = (_trench getVariable [QGVAR(diggingSteps), 0]) * _diggerCount; _pos set [2,(_pos select 2) + _posDiff]; - _trench setPosWorld _pos; _trench setVectorDirAndUp _vecDirAndUp; @@ -127,7 +126,7 @@ if (_actualProgress == 0) then { // Save progress _trench setVariable [QGVAR(progress), _actualProgress + ((1/(_digTime *10)) * _diggerCount)]; - if (GVAR(stopBuildingAtFatigueMax) && EGVAR(advanced_fatigue,anReserve) <= 0) exitWith { + if (GVAR(stopBuildingAtFatigueMax) && {EGVAR(advanced_fatigue,anReserve) <= 0}) exitWith { [_handle] call CBA_fnc_removePerFrameHandler; _trench setVariable [QGVAR(digging), false, true]; _trench setVariable [QGVAR(diggingPlayers), _trench getVariable [QGVAR(diggingPlayers), []] - [_unit], true]; diff --git a/addons/trenches/functions/fnc_getSurfaceTexturePath.sqf b/addons/trenches/functions/fnc_getSurfaceTexturePath.sqf index 89e9d3069e5..0753de8656b 100644 --- a/addons/trenches/functions/fnc_getSurfaceTexturePath.sqf +++ b/addons/trenches/functions/fnc_getSurfaceTexturePath.sqf @@ -19,8 +19,6 @@ params [ ["_object", objnull, [objNull]] ]; -diag_log format ["ACE_TRENCHES Object: %1", _object]; - if (isNull _object) exitWith {}; if !((isNil QGVAR(automaticFileSetup)) && {isText (configFile >> "CfgWorldTexture" >> worldName >> "surfaceTextureBasePath")}) exitWith {DEFAULT_TEXTURE}; @@ -60,6 +58,4 @@ private _result = if !(isNil QGVAR(automaticFileSetup)) then { [_surfaceType, _basePath, getText(configFile >> "CfgWorldTexture" >> worldName >> "suffix")] call _getTexturePath; }; -diag_log format ["ACE_TRENCHES Result: %1", _result]; - _result diff --git a/addons/trenches/functions/fnc_placeConfirm.sqf b/addons/trenches/functions/fnc_placeConfirm.sqf index 1e3ac8a0bf8..8882d65246c 100644 --- a/addons/trenches/functions/fnc_placeConfirm.sqf +++ b/addons/trenches/functions/fnc_placeConfirm.sqf @@ -41,8 +41,9 @@ private _pos = getPosWorld GVAR(trench); deleteVehicle GVAR(trench); private _trench = createVehicle [_trenchClass, _pos, [], 0, "CAN_COLLIDE"]; -_trench setObjectTextureGlobal [0, [_trench] call FUNC(getSurfaceTexturePath)]; _trench setPosWorld _pos; +_trench setVectorDirAndUp _vecDirAndUp; +_trench setObjectTextureGlobal [0, [_trench] call FUNC(getSurfaceTexturePath)]; private _boundingBox = 0 boundingBoxReal _trench; _boundingBox params ["_lbfc", "_rtbc"]; //_lbfc(Left Bottom Front Corner) _rtbc (Right Top Back Corner) @@ -53,7 +54,8 @@ private _posDiff = abs _lbfcZ + abs _rtbcZ; private _newPos = _trench modelToWorldWorld [0, 0, -_posDiff]; _trench setPosWorld _newPos; -_trench setVariable [QGVAR(diggingSteps), _posDiff/100,true]; +private _digTime = missionNamespace getVariable [getText (configFile >> "CfgVehicles" >> (typeOf _trench) >> QGVAR(diggingDuration)), 20]; +_trench setVariable [QGVAR(diggingSteps), _posDiff/_digTime, true]; _trench setVectorDirAndUp _vecDirAndUp; _trench setVariable [QGVAR(placeData), [_newPos, _vecDirAndUp], true]; diff --git a/addons/trenches/functions/fnc_removeTrench.sqf b/addons/trenches/functions/fnc_removeTrench.sqf index 9f7534a8b50..a33d3381152 100644 --- a/addons/trenches/functions/fnc_removeTrench.sqf +++ b/addons/trenches/functions/fnc_removeTrench.sqf @@ -108,7 +108,7 @@ private _fnc_condition = { _lbfc params ["", "", "_lbfcZ"]; private _pos = getPosWorld _trench; - private _posDiff = (abs(((_trench getVariable [QGVAR(diggingSteps), 0]) * _diggerCount) + _lbfcZ))/(_removeTime*5); + private _posDiff = (_trench getVariable [QGVAR(diggingSteps), 0]) * _diggerCount; _pos set [2,((_pos select 2) - _posDiff)]; _trench setPosWorld _pos;