2015-12-07 16:24:52 +00:00
|
|
|
/*
|
|
|
|
Author: Aaron Clark - EpochMod.com
|
|
|
|
|
|
|
|
Contributors:
|
|
|
|
|
|
|
|
Description:
|
|
|
|
Epoch Chopwood function
|
|
|
|
|
|
|
|
Licence:
|
|
|
|
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
|
|
|
|
|
|
|
|
Github:
|
2016-06-13 16:54:19 +00:00
|
|
|
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/EPOCH_chopWood.sqf
|
2015-12-07 16:24:52 +00:00
|
|
|
*/
|
2016-09-01 00:29:08 +00:00
|
|
|
//[[[cog import generate_private_arrays ]]]
|
2017-06-05 00:22:56 +00:00
|
|
|
private ["_currentPos","_getWorldTypes","_object","_objects","_sel_object","_type","_worldTypes"];
|
2016-09-01 00:29:08 +00:00
|
|
|
//[[[end]]]
|
2015-09-14 20:55:36 +00:00
|
|
|
|
|
|
|
_currentPos = player modelToWorld[0, 5, 0];
|
|
|
|
if !(surfaceIsWater _currentPos) then {
|
|
|
|
_currentPos = ATLtoASL _currentPos;
|
|
|
|
};
|
|
|
|
|
|
|
|
_objects = lineIntersectsObjs[eyePos player, _currentPos, player, objNull, true, 2];
|
|
|
|
_object = objNull;
|
|
|
|
_type = 0;
|
|
|
|
|
|
|
|
{
|
2017-06-05 00:22:56 +00:00
|
|
|
_sel_object = _x;
|
2016-04-08 20:21:46 +00:00
|
|
|
_worldTypes = ["tree","bush"];
|
2017-06-05 00:22:56 +00:00
|
|
|
_getWorldTypes = [_x, _worldTypes] call EPOCH_worldObjectType;
|
2016-04-08 20:21:46 +00:00
|
|
|
{
|
|
|
|
if (_getWorldTypes param [_worldTypes find _x, false]) exitWith {
|
|
|
|
_type = _forEachIndex;
|
|
|
|
_object = _sel_object;
|
2016-01-28 19:36:35 +00:00
|
|
|
};
|
2016-04-08 20:21:46 +00:00
|
|
|
} forEach _worldTypes;
|
|
|
|
|
2015-09-14 20:55:36 +00:00
|
|
|
if !(isNull _object) exitWith {};
|
|
|
|
}foreach _objects;
|
|
|
|
|
|
|
|
if (!isNull _object) then {
|
|
|
|
if (alive _object) then {
|
2015-12-23 17:38:11 +00:00
|
|
|
[_object,_type,player,EPOCH_personalToken] remoteExec ["EPOCH_server_knockDownTree",2];
|
2015-09-14 20:55:36 +00:00
|
|
|
};
|
2015-12-07 16:24:52 +00:00
|
|
|
};
|