Skip to content

Commit 5ae0345

Browse files
committed
Adjusting height of cargo, adding allowDamage back
This might resolve some of the issues seen where vehicles are exploding while being towed
1 parent a17a9ee commit 5ae0345

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

addons/SA_AdvancedTowing.pbo

4.67 KB
Binary file not shown.
0 Bytes
Binary file not shown.

addons/SA_AdvancedTowing/functions/fn_advancedTowingInit.sqf

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ SA_Simulate_Towing = {
131131
_cargoModelCenterGroundPosition = _cargo worldToModelVisual _cargoCenterOfMassAGL;
132132
_cargoModelCenterGroundPosition set [0,0];
133133
_cargoModelCenterGroundPosition set [1,0];
134+
_cargoModelCenterGroundPosition set [2, (_cargoModelCenterGroundPosition select 2) - 0.10]; // Adjust height so that it doesn't ride directly on ground
134135

135136
// Calculate cargo model corner points
136137
private ["_cargoCornerPoints"];
@@ -202,13 +203,15 @@ SA_Simulate_Towing = {
202203
_surfaceNormal1 = (_cargoCorner1ASL vectorFromTo _cargoCorner3ASL) vectorCrossProduct (_cargoCorner1ASL vectorFromTo _cargoCorner2ASL);
203204
_surfaceNormal2 = (_cargoCorner4ASL vectorFromTo _cargoCorner2ASL) vectorCrossProduct (_cargoCorner4ASL vectorFromTo _cargoCorner3ASL);
204205
_surfaceNormal = _surfaceNormal1 vectorAdd _surfaceNormal2;
205-
206+
206207
_newCargoPosition = _newCargoPosition vectorAdd ( _cargoModelCenterGroundPosition vectorMultiply -1 );
207-
208+
209+
_cargo allowDamage false;
208210
_cargo setVectorDir _newCargoDir;
209211
_cargo setVectorUp _surfaceNormal;
210212
_cargo setPosWorld _newCargoPosition;
211-
213+
_cargo allowDamage true;
214+
212215
_lastCargoHitchPosition = _newCargoHitchPosition;
213216
_maxDistanceToCargo = _vehicleHitchPosition distance _newCargoHitchPosition;
214217
_lastMovedCargoPosition = _cargoPosition;

0 commit comments

Comments
 (0)