mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 04:02:37 +03:00
Merge pull request #1431 from raymix/master
snap building plotpole / infinite drag fix
This commit is contained in:
@@ -14,6 +14,7 @@ class SnapBuilding {
|
|||||||
"BagFenceRound_DZ",
|
"BagFenceRound_DZ",
|
||||||
"Fort_RazorWire"
|
"Fort_RazorWire"
|
||||||
};
|
};
|
||||||
|
radius = 5;
|
||||||
};
|
};
|
||||||
//snap points
|
//snap points
|
||||||
class Land_HBarrier5Preview: Barrier{ //fix for broken offsets in ghost
|
class Land_HBarrier5Preview: Barrier{ //fix for broken offsets in ghost
|
||||||
@@ -122,6 +123,7 @@ class SnapBuilding {
|
|||||||
"CinderWallDoorSmall_DZ",
|
"CinderWallDoorSmall_DZ",
|
||||||
"MetalFloor_DZ"
|
"MetalFloor_DZ"
|
||||||
};
|
};
|
||||||
|
radius = 5;
|
||||||
};
|
};
|
||||||
|
|
||||||
class WoodFloorQuarter_Preview_DZ: FloorsWallsStairs { //fix for broken offsets in ghost
|
class WoodFloorQuarter_Preview_DZ: FloorsWallsStairs { //fix for broken offsets in ghost
|
||||||
@@ -171,6 +173,7 @@ class SnapBuilding {
|
|||||||
{-2.45,0,0.130,"Left"},
|
{-2.45,0,0.130,"Left"},
|
||||||
{2.45,0,0.130,"Right"}
|
{2.45,0,0.130,"Right"}
|
||||||
};
|
};
|
||||||
|
radius = 10;
|
||||||
};
|
};
|
||||||
class WoodFloor_DZ: WoodFloor_Preview_DZ{};
|
class WoodFloor_DZ: WoodFloor_Preview_DZ{};
|
||||||
|
|
||||||
@@ -183,6 +186,7 @@ class SnapBuilding {
|
|||||||
{-1.73926,0.05,0,"Bottom"}
|
{-1.73926,0.05,0,"Bottom"}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
class WoodStairs_DZ: Stairs_DZE {};
|
||||||
class WoodStairs_Preview_DZ: Stairs_DZE {};
|
class WoodStairs_Preview_DZ: Stairs_DZE {};
|
||||||
class WoodStairsSans_Preview_DZ: Stairs_DZE {};
|
class WoodStairsSans_Preview_DZ: Stairs_DZE {};
|
||||||
class WoodStairsSans_DZ: Stairs_DZE {};
|
class WoodStairsSans_DZ: Stairs_DZE {};
|
||||||
@@ -203,6 +207,7 @@ class SnapBuilding {
|
|||||||
class WoodSmallWallWin_DZ: WoodSmall_DZE {};
|
class WoodSmallWallWin_DZ: WoodSmall_DZE {};
|
||||||
class Land_DZE_WoodDoor: WoodSmall_DZE {};
|
class Land_DZE_WoodDoor: WoodSmall_DZE {};
|
||||||
class Land_DZE_WoodDoorLocked: WoodSmall_DZE {};
|
class Land_DZE_WoodDoorLocked: WoodSmall_DZE {};
|
||||||
|
class WoodDoor_Preview_DZ: WoodSmall_DZE{};
|
||||||
|
|
||||||
class WoodLarge_DZE: FloorsWallsStairs { //Large wood walls
|
class WoodLarge_DZE: FloorsWallsStairs { //Large wood walls
|
||||||
points[] = {
|
points[] = {
|
||||||
@@ -241,6 +246,7 @@ class SnapBuilding {
|
|||||||
{2.752, 0, 1.5,"Right"},
|
{2.752, 0, 1.5,"Right"},
|
||||||
{0, 0, 3.37042,"Top"}
|
{0, 0, 3.37042,"Top"}
|
||||||
};
|
};
|
||||||
|
radius = 5;
|
||||||
};
|
};
|
||||||
class CinderWall_Preview_DZ: Cinder_DZE {};
|
class CinderWall_Preview_DZ: Cinder_DZE {};
|
||||||
class CinderWallDoorway_Preview_DZ: Cinder_DZE {};
|
class CinderWallDoorway_Preview_DZ: Cinder_DZE {};
|
||||||
@@ -277,6 +283,7 @@ class SnapBuilding {
|
|||||||
{-2.64, 0, 0.009,"Left"},
|
{-2.64, 0, 0.009,"Left"},
|
||||||
{2.64, 0, 0.009,"Right"}
|
{2.64, 0, 0.009,"Right"}
|
||||||
};
|
};
|
||||||
|
radius = 10;
|
||||||
};
|
};
|
||||||
class MetalFloor_DZ: FloorsWallsStairs{
|
class MetalFloor_DZ: FloorsWallsStairs{
|
||||||
points[] = {
|
points[] = {
|
||||||
@@ -286,6 +293,7 @@ class SnapBuilding {
|
|||||||
{-2.64, 0, 0.15,"Left"},
|
{-2.64, 0, 0.15,"Left"},
|
||||||
{2.64, 0, 0.15,"Right"}
|
{2.64, 0, 0.15,"Right"}
|
||||||
};
|
};
|
||||||
|
radius = 10;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -294,6 +302,7 @@ class SnapBuilding {
|
|||||||
snapTo[] = {
|
snapTo[] = {
|
||||||
"WoodCrate_DZ"
|
"WoodCrate_DZ"
|
||||||
};
|
};
|
||||||
|
radius = 5;
|
||||||
points[] = {
|
points[] = {
|
||||||
{0,0,0,"Pivot"},
|
{0,0,0,"Pivot"},
|
||||||
{0,-0.47,0,"Back"},
|
{0,-0.47,0,"Back"},
|
||||||
@@ -308,6 +317,7 @@ class SnapBuilding {
|
|||||||
snapTo[] = {
|
snapTo[] = {
|
||||||
"MetalPanel_DZ"
|
"MetalPanel_DZ"
|
||||||
};
|
};
|
||||||
|
radius = 5;
|
||||||
points[] = {
|
points[] = {
|
||||||
{0,0,0,"Pivot"},
|
{0,0,0,"Pivot"},
|
||||||
{-1.5,0,0,"Left"},
|
{-1.5,0,0,"Left"},
|
||||||
@@ -319,6 +329,7 @@ class SnapBuilding {
|
|||||||
snapTo[] = {
|
snapTo[] = {
|
||||||
"MetalGate_DZ"
|
"MetalGate_DZ"
|
||||||
};
|
};
|
||||||
|
radius = 5;
|
||||||
points[] = {
|
points[] = {
|
||||||
{0,0,0,"Pivot"},
|
{0,0,0,"Pivot"},
|
||||||
{-4.1,0,0,"Left"}
|
{-4.1,0,0,"Left"}
|
||||||
@@ -329,6 +340,7 @@ class SnapBuilding {
|
|||||||
snapTo[] = {
|
snapTo[] = {
|
||||||
"StickFence_DZ"
|
"StickFence_DZ"
|
||||||
};
|
};
|
||||||
|
radius = 5;
|
||||||
points[] = {
|
points[] = {
|
||||||
{0,0,0,"Pivot"},
|
{0,0,0,"Pivot"},
|
||||||
{-2.95,0,0.3,"Left"},
|
{-2.95,0,0.3,"Left"},
|
||||||
@@ -340,6 +352,7 @@ class SnapBuilding {
|
|||||||
snapTo[] = {
|
snapTo[] = {
|
||||||
"Fence_corrugated_DZ"
|
"Fence_corrugated_DZ"
|
||||||
};
|
};
|
||||||
|
radius = 5;
|
||||||
points[] = {
|
points[] = {
|
||||||
{0,0,0,"Pivot"},
|
{0,0,0,"Pivot"},
|
||||||
{-1.95,0,0.88,"Left"},
|
{-1.95,0,0.88,"Left"},
|
||||||
@@ -351,6 +364,7 @@ class SnapBuilding {
|
|||||||
snapTo[] = {
|
snapTo[] = {
|
||||||
"WoodRamp_DZ"
|
"WoodRamp_DZ"
|
||||||
};
|
};
|
||||||
|
radius = 5;
|
||||||
points[] = {
|
points[] = {
|
||||||
{0,0,0,"Pivot"},
|
{0,0,0,"Pivot"},
|
||||||
{0.65,-1.7,1.2,"Back"},
|
{0.65,-1.7,1.2,"Back"},
|
||||||
@@ -364,6 +378,7 @@ class SnapBuilding {
|
|||||||
snapTo[] = {
|
snapTo[] = {
|
||||||
"WoodLadder_DZ"
|
"WoodLadder_DZ"
|
||||||
};
|
};
|
||||||
|
radius = 5;
|
||||||
points[] = {
|
points[] = {
|
||||||
{0,0,0,"Pivot"},
|
{0,0,0,"Pivot"},
|
||||||
{-0.4,0,1.725,"Left"},
|
{-0.4,0,1.725,"Left"},
|
||||||
@@ -377,6 +392,7 @@ class SnapBuilding {
|
|||||||
"VaultStorageLocked",
|
"VaultStorageLocked",
|
||||||
"VaultStorage"
|
"VaultStorage"
|
||||||
};
|
};
|
||||||
|
radius = 5;
|
||||||
points[] = {
|
points[] = {
|
||||||
{0,0,0,"Pivot"},
|
{0,0,0,"Pivot"},
|
||||||
{0,0.284,0.615,"Back"},
|
{0,0.284,0.615,"Back"},
|
||||||
|
|||||||
@@ -386,6 +386,32 @@ if (isClass (configFile >> "SnapBuilding" >> _classname)) then {
|
|||||||
deleteVehicle _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 {
|
if(abs(_objHDiff) > 10) exitWith {
|
||||||
_isOk = false;
|
_isOk = false;
|
||||||
_cancel = true;
|
_cancel = true;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
// July 10 2014 //
|
// 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
|
//Args
|
||||||
snapActionState = _this select 3 select 0;
|
snapActionState = _this select 3 select 0;
|
||||||
_object = _this select 3 select 1;
|
_object = _this select 3 select 1;
|
||||||
@@ -15,6 +15,7 @@ _selectedAction = _this select 3 select 4;
|
|||||||
_cfg = (configFile >> "SnapBuilding" >> _classname);
|
_cfg = (configFile >> "SnapBuilding" >> _classname);
|
||||||
_whitelist = getArray (_cfg >> "snapTo");
|
_whitelist = getArray (_cfg >> "snapTo");
|
||||||
_points = getArray (_cfg >> "points");
|
_points = getArray (_cfg >> "points");
|
||||||
|
_radius = getNumber (_cfg >> "radius");
|
||||||
|
|
||||||
//colors
|
//colors
|
||||||
_objColorActive = "#(argb,8,8,3)color(0,0.92,0.06,1,ca)";
|
_objColorActive = "#(argb,8,8,3)color(0,0.92,0.06,1,ca)";
|
||||||
@@ -58,7 +59,7 @@ fnc_initSnapPoints = {
|
|||||||
fnc_initSnapPointsNearby = {
|
fnc_initSnapPointsNearby = {
|
||||||
_pos = getPosATL _object;
|
_pos = getPosATL _object;
|
||||||
_findWhitelisted = []; _pointsNearby = [];
|
_findWhitelisted = []; _pointsNearby = [];
|
||||||
_findWhitelisted = nearestObjects [_pos,_whitelist,10]-[_object];
|
_findWhitelisted = nearestObjects [_pos,_whitelist,_radius]-[_object];
|
||||||
snapGizmosNearby = [];
|
snapGizmosNearby = [];
|
||||||
{
|
{
|
||||||
_nearbyObject = _x;
|
_nearbyObject = _x;
|
||||||
|
|||||||
Reference in New Issue
Block a user