Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- comment {
- function f_in_forest extracted from DASH library 2.5 by SoldierEPilot
- addons\DASH_library.pbo\stringtable.csv
- https://www.ofpec.com/forum/index.php?topic=36435.0
- };
- f_in_forest = {
- private [{_refpos},{_rad},{_radinc},{_x},{_y},{_z},{_r},{_refobj},{_oa},{_radcnt},{_inc},{_bad},{_dir},{_o},{_dis}];
- _refpos = _this select 0;
- _rad = (_this select 1) + 36;
- _radinc = _rad / ((_rad/10) - ((_rad/10)%1));
- _X = _refpos select 0;
- _Y = _refpos select 1;
- _Z = 18;
- _r = false;
- _refobj = {dash.logic} call localize {f_db_get};
- _oA = [];
- _radcnt = 0;
- _inc = 0;
- _bad = {dash.fake_obstacles} call localize {f_db_get};
- While {_radcnt <= _rad && !_r} Do {
- if (_radcnt>0) then {
- _inc = 360/((360/Asin(_radinc/_radcnt))-((360/Asin(_radinc/_radcnt))%1))
- };
- _dir=0;
- While {_dir<360 && !_r} Do {
- _o = nearestObject [(_X+(_radcnt*Sin _dir)),(_Y+(_radcnt*Cos _dir)),_Z];
- if (format[""%1"",_o]!=""<NULL-object>""&&!(_o in _oA)&&!((typeOf _o)in _bad)) then {
- _oA = _oA + [_o];
- _dis = [getPos _o, _refpos] call localize {f_dist2d};
- if (_dis<=_rad) then {
- _refobj setPos(getPos _o);
- _dis = _refobj distance _o;
- _r = [[[6.8,6.9],[10.9,12.5],[13,1000],[6.18,6.2],[6.5,6.6],[6.95,7],[7.8,7.9],[8.3,8.4],[8.47,8.5],[9.08,10.42]],_dis] call localize {f_in_ranges};
- _r = _r || _dis == 2.02113;
- _refobj setPos[0,0,1000];
- };
- };
- if (_inc>0) then {_dir=_dir+_inc} else {_dir=360};
- };
- _radcnt=_radcnt+_radinc;
- };
- _refobj setPos[0,0,0];
- _r
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement