mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-14 04:02:56 +03:00
snap optimization for large bases
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
// July 10 2014 //
|
||||
/*--------------------------------*/
|
||||
|
||||
private ["_object","_objectSnapGizmo","_objColorActive","_objColorInactive","_classname","_whitelist","_points","_cfg","_cnt","_pos","_findWhitelisted","_nearbyObject","_posNearby","_selectedAction","_newPos","_pointsNearby","_onWater"];
|
||||
private ["_object","_objectSnapGizmo","_objColorActive","_objColorInactive","_classname","_whitelist","_points","_radius","_cfg","_cnt","_pos","_findWhitelisted","_nearbyObject","_posNearby","_selectedAction","_newPos","_pointsNearby","_onWater"];
|
||||
//Args
|
||||
snapActionState = _this select 3 select 0;
|
||||
_object = _this select 3 select 1;
|
||||
@@ -15,6 +15,7 @@ _selectedAction = _this select 3 select 4;
|
||||
_cfg = (configFile >> "SnapBuilding" >> _classname);
|
||||
_whitelist = getArray (_cfg >> "snapTo");
|
||||
_points = getArray (_cfg >> "points");
|
||||
_radius = getNumber (_cfg >> "radius");
|
||||
|
||||
//colors
|
||||
_objColorActive = "#(argb,8,8,3)color(0,0.92,0.06,1,ca)";
|
||||
@@ -58,7 +59,7 @@ fnc_initSnapPoints = {
|
||||
fnc_initSnapPointsNearby = {
|
||||
_pos = getPosATL _object;
|
||||
_findWhitelisted = []; _pointsNearby = [];
|
||||
_findWhitelisted = nearestObjects [_pos,_whitelist,10]-[_object];
|
||||
_findWhitelisted = nearestObjects [_pos,_whitelist,_radius]-[_object];
|
||||
snapGizmosNearby = [];
|
||||
{
|
||||
_nearbyObject = _x;
|
||||
|
||||
Reference in New Issue
Block a user