From 679ea3fcc5884e8e96543d53c79bc14d6795a0bd Mon Sep 17 00:00:00 2001 From: sethduda Date: Sat, 26 Mar 2016 22:06:23 -0400 Subject: [PATCH] Fixing issue causing cargo to drive on top of trees / bushes --- addons/SA_AdvancedTowing.pbo | Bin 28813 -> 28870 bytes ...A_AdvancedTowing.pbo.AdvancedTowing.bisign | Bin 567 -> 567 bytes .../functions/fn_advancedTowingInit.sqf | 30 ++++++++++-------- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/addons/SA_AdvancedTowing.pbo b/addons/SA_AdvancedTowing.pbo index bbd535daaed568bd7eb6abc8c71697ba8a6d5ec6..af04dbe040df285989ee2ed8450a9d5b21440a82 100644 GIT binary patch delta 498 zcmeBu$aw4_;{-RReEW$WW~|Zn-@~?SY|dd~HL|oYFyH)z=?p8Q>EuHkW%Z`9)(SDa zT=7MzC8b4q!KFoMiOH#s!9EJM3XbkRA^9L?d_jJ3W=Up#9#90Vx*DW~vp6}wAk{B1 zH&sEY7^2T7Kfgc;tb#K$O+z8G*snAvM?oXLLZLV{CpEc5!AMgQU;9i=%kV{$% z(=VJjd^7nbm#jpsLRx;2YhrSSLOe7Si@{Eu{GH1d7&;0pwLtD<2X?i|ch%W9cXPi> a5!p~>?%`|N8Nzh>_+kalKGmQLsy6_?7@OMw delta 391 zcmX^1kg@k6;{-RRT|yH*%vfuMzK2zBY|dd~HMB4`Gur%x=?p8Ap~2*X9A!*Kv6B^f zMJDrbm^d56S}Vlxa%HAzB@1Tn@JLOLQsbIjz|Ou|nWsNRM6g}K=-Z~4w&znm OH91G`S3mRpWdQ(ql6%|$ diff --git a/addons/SA_AdvancedTowing.pbo.AdvancedTowing.bisign b/addons/SA_AdvancedTowing.pbo.AdvancedTowing.bisign index 37a2df4ce59d9bf3c64434bb66d6c7ba5f62ff36..25b7c1e12f37a23e8e33d209027e96906a34c4c0 100644 GIT binary patch delta 406 zcmV;H0crlX1h)i`tAE>=5H4>`vs)SeRgR?~AT)|r8j0gGjx#FV65O(s+hyAVowZhK zfO(6V7@0W_dQXR{ccH>xOGC|+-1kX2fcrc7p3Z@}RZQb*2vYk4W^(|1kFb9l`dG=4 zT06_3WXcX6*ot}Tclemgox(FR(QZ-7e~{F9w3@4Z*b$eNwSRL00001h00016#{^5u zIy$$BFBE44!^`M$*c)OF@I_gW!{o)7LwM@ky#g)rfy84H@@4s~Y_MHbfSn5h2R!`n zmEPvPul4HC1c{7fPtJb-T!~gfx>(L$G5{GJN!n5Xse~!acq50`#MQ)3rc51Znt()p z4SJ|H_32_o(SMZ~ll~)tx(U8D(f4=&4S1`{~DBe8IByN z!ZiyQw?stNm*n;AN*NS$ZWyrjtF*lsQ5_`6OdD`kGY{-#UOc(K680j{5rqRR0Eb(^ A2LJ#7 delta 406 zcmV;H0crlX1h)i`tA7wdr*4I|*w)WakE^N;s8*NOf*xS;>+5@fIcNaXZ|9E>943DS z?+ipo5VPv-QsTWYj>YnvKTLDJ3NPbJ9s-uCgZx~#FmTWDJ0`C7)edxiEJ1%h@0o33?2a)Y~i`3P0{Fjg=95`74 zQ7ErW^Ej%KU1`ZlInD~!9#2(#Ma?*`8y;dsCf!2Gr{j0;>`dYr2R!o|Nd5isj=c~E z(gK!7>_;=6hJRD%AV^KR$?kVxfB*mhYs!ro+O~`;IGUvRRGw(yoS9>TMqoojb7Z87 zM>`-gB$2zuv<&hsL=|~%7i02B@EunP?(Af4)t?=Q3;K(p8!YRFY860p6`*QUUMl`8 z|9z7r8dU*KSOcL|rc{|^PWItf&TOaq;vkc(cUz*gUk`WSk`ny%P3fj8IF$`t4#&*D Apa1{> diff --git a/addons/SA_AdvancedTowing/functions/fn_advancedTowingInit.sqf b/addons/SA_AdvancedTowing/functions/fn_advancedTowingInit.sqf index cd85ae4..7f79985 100644 --- a/addons/SA_AdvancedTowing/functions/fn_advancedTowingInit.sqf +++ b/addons/SA_AdvancedTowing/functions/fn_advancedTowingInit.sqf @@ -13,23 +13,27 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI #define SA_Find_Surface_ASL_Under_Position(_object,_positionAGL,_returnSurfaceASL,_canFloat) \ _objectASL = AGLToASL (_object modelToWorldVisual (getCenterOfMass _object)); \ _surfaceIntersectStartASL = [_positionAGL select 0, _positionAGL select 1, (_objectASL select 2) + 1]; \ -_surfaceIntersectEndASL = [_positionAGL select 0, _positionAGL select 1, (_objectASL select 2) - 10]; \ -_surfaces = lineIntersectsSurfaces [_surfaceIntersectStartASL, _surfaceIntersectEndASL, _object, objNull, true, 2]; \ -_returnSurfaceASL = [_positionAGL select 0, _positionAGL select 1, 0]; \ -if(count _surfaces > 0) then { \ - if!(((_surfaces select 0) select 2) isKindOf "RopeSegment") then { \ - _returnSurfaceASL = (_surfaces select 0) select 0; \ +_surfaceIntersectEndASL = [_positionAGL select 0, _positionAGL select 1, (_objectASL select 2) - 5]; \ +_surfaces = lineIntersectsSurfaces [_surfaceIntersectStartASL, _surfaceIntersectEndASL, _object, objNull, true, 5]; \ +_returnSurfaceASL = AGLToASL _positionAGL; \ +{ \ + scopeName "surfaceLoop"; \ + if( isNull (_x select 2) ) then { \ + _returnSurfaceASL = _x select 0; \ + breakOut "surfaceLoop"; \ } else { \ - if(count _surfaces > 1) then { \ - if!(((_surfaces select 1) select 2) isKindOf "RopeSegment") then { \ - _returnSurfaceASL = (_surfaces select 1) select 0; \ + if!((_x select 2) isKindOf "RopeSegment") then { \ + _objectFileName = str (_x select 2); \ + if((_objectFileName find " t_") == -1 && (_objectFileName find " b_") == -1) then { \ + _returnSurfaceASL = _x select 0; \ + breakOut "surfaceLoop"; \ }; \ }; \ }; \ - if(_canFloat && (_returnSurfaceASL select 2) < 0) then { \ - _returnSurfaceASL set [2,0]; \ - }; \ -}; +} forEach _surfaces; \ +if(_canFloat && (_returnSurfaceASL select 2) < 0) then { \ + _returnSurfaceASL set [2,0]; \ +}; \ #define SA_Find_Surface_ASL_Under_Model(_object,_modelOffset,_returnSurfaceASL,_canFloat) \ SA_Find_Surface_ASL_Under_Position(_object, (_object modelToWorldVisual _modelOffset), _returnSurfaceASL,_canFloat);