mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-22 08:00:49 +03:00
Merge pull request #1431 from raymix/master
snap building plotpole / infinite drag fix
This commit is contained in:
@@ -385,6 +385,32 @@ if (isClass (configFile >> "SnapBuilding" >> _classname)) then {
|
||||
detach _objectHelper;
|
||||
deleteVehicle _objectHelper;
|
||||
};
|
||||
|
||||
if(_IsNearPlot == 0 && !_isPole) then {
|
||||
_findNearestPoles = nearestObjects [_objectHelper, ["Plastic_Pole_EP1_DZ"], 30];
|
||||
_nearestPole = _findNearestPoles select 0;
|
||||
_objectHelperPos = getPosATL _objectHelper;
|
||||
if (_objectHelperPos distance _nearestPole < 30) exitWith {
|
||||
_isOk = false;
|
||||
_cancel = true;
|
||||
_reason = "You cannot enter plot pole area while building is in progress";
|
||||
detach _object;
|
||||
deleteVehicle _object;
|
||||
detach _objectHelper;
|
||||
deleteVehicle _objectHelper;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
if(_location1 distance _objectHelperPos > 10) exitWith {
|
||||
_isOk = false;
|
||||
_cancel = true;
|
||||
_reason = "Object is placed to far away from where you started building (within 10 meters)";
|
||||
detach _object;
|
||||
deleteVehicle _object;
|
||||
detach _objectHelper;
|
||||
deleteVehicle _objectHelper;
|
||||
};
|
||||
|
||||
if(abs(_objHDiff) > 10) exitWith {
|
||||
_isOk = false;
|
||||
|
||||
@@ -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