From 28101a0603a01dfe40adecf61dd2ba123824c6a2 Mon Sep 17 00:00:00 2001 From: sethduda Date: Tue, 12 Apr 2016 23:04:14 -0400 Subject: [PATCH] Adjusting cargo corner points --- .../functions/fn_advancedSlingLoadingInit.sqf | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/addons/SA_AdvancedSlingLoading/functions/fn_advancedSlingLoadingInit.sqf b/addons/SA_AdvancedSlingLoading/functions/fn_advancedSlingLoadingInit.sqf index 3b4fb5f..878aa2d 100644 --- a/addons/SA_AdvancedSlingLoading/functions/fn_advancedSlingLoadingInit.sqf +++ b/addons/SA_AdvancedSlingLoading/functions/fn_advancedSlingLoadingInit.sqf @@ -435,11 +435,11 @@ ASL_Can_Put_Away_Ropes = { ASL_Get_Corner_Points = { params ["_vehicle"]; private ["_centerOfMass","_bbr","_p1","_p2","_rearCorner","_rearCorner2","_frontCorner","_frontCorner2"]; - private ["_maxWidth","_widthOffset","_maxLength","_lengthOffset","_widthFactor","_lengthFactor"]; + private ["_maxWidth","_widthOffset","_maxLength","_lengthOffset","_widthFactor","_lengthFactor","_maxHeight","_heightOffset"]; // Correct width and length factor for air - _widthFactor = 0.75; - _lengthFactor = 0.75; + _widthFactor = 0.5; + _lengthFactor = 0.5; if(_vehicle isKindOf "Air") then { _widthFactor = 0.3; }; @@ -456,10 +456,13 @@ ASL_Get_Corner_Points = { _widthOffset = ((_maxWidth / 2) - abs ( _centerOfMass select 0 )) * _widthFactor; _maxLength = abs ((_p2 select 1) - (_p1 select 1)); _lengthOffset = ((_maxLength / 2) - abs (_centerOfMass select 1 )) * _lengthFactor; - _rearCorner = [(_centerOfMass select 0) + _widthOffset, (_centerOfMass select 1) - _lengthOffset, _centerOfMass select 2]; - _rearCorner2 = [(_centerOfMass select 0) - _widthOffset, (_centerOfMass select 1) - _lengthOffset, _centerOfMass select 2]; - _frontCorner = [(_centerOfMass select 0) + _widthOffset, (_centerOfMass select 1) + _lengthOffset, _centerOfMass select 2]; - _frontCorner2 = [(_centerOfMass select 0) - _widthOffset, (_centerOfMass select 1) + _lengthOffset, _centerOfMass select 2]; + _maxHeight = abs ((_p2 select 2) - (_p1 select 2)); + _heightOffset = _maxHeight/6; + + _rearCorner = [(_centerOfMass select 0) + _widthOffset, (_centerOfMass select 1) - _lengthOffset, (_centerOfMass select 2)+_heightOffset]; + _rearCorner2 = [(_centerOfMass select 0) - _widthOffset, (_centerOfMass select 1) - _lengthOffset, (_centerOfMass select 2)+_heightOffset]; + _frontCorner = [(_centerOfMass select 0) + _widthOffset, (_centerOfMass select 1) + _lengthOffset, (_centerOfMass select 2)+_heightOffset]; + _frontCorner2 = [(_centerOfMass select 0) - _widthOffset, (_centerOfMass select 1) + _lengthOffset, (_centerOfMass select 2)+_heightOffset]; [_rearCorner,_rearCorner2,_frontCorner,_frontCorner2]; };