From f3700efba74ec426624759e63f7335c69b6bc972 Mon Sep 17 00:00:00 2001 From: "DESKTOP-UH65DCE\\MusTanG" Date: Mon, 2 Oct 2017 17:05:53 -0500 Subject: [PATCH] vector corrections and improvements Correct vector snap issues clientside Correct vector placement issues server side Correct remoteExec reveal to clients(fixes incorrect placement during swap) --- Sources/epoch_code/compile/building/EPOCH_staticMove.sqf | 3 +-- .../compile/epoch_bases/EPOCH_swapBuilding.sqf | 7 ++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/epoch_code/compile/building/EPOCH_staticMove.sqf b/Sources/epoch_code/compile/building/EPOCH_staticMove.sqf index 14b93b6c..fe8e9998 100644 --- a/Sources/epoch_code/compile/building/EPOCH_staticMove.sqf +++ b/Sources/epoch_code/compile/building/EPOCH_staticMove.sqf @@ -287,9 +287,8 @@ if (_class != "") then { if (surfaceIsWater _snapPosition) then { _snapPosition = ASLtoATL _snapPosition; }; - - _currentTarget setposATL _snapPosition; _currentTarget setVectorDirAndUp[_dir2, (vectorUp _nearestObject)]; + _currentTarget setposATL _snapPosition; // Vector + Snapping if(!(_vectorUp select 0 == 0) || !(_vectorUp select 1 == 0) || !(_vectorUp select 2 == 1)) then{ diff --git a/Sources/epoch_server/compile/epoch_bases/EPOCH_swapBuilding.sqf b/Sources/epoch_server/compile/epoch_bases/EPOCH_swapBuilding.sqf index 2272280d..ceda28ac 100644 --- a/Sources/epoch_server/compile/epoch_bases/EPOCH_swapBuilding.sqf +++ b/Sources/epoch_server/compile/epoch_bases/EPOCH_swapBuilding.sqf @@ -19,8 +19,9 @@ if (!isNull _object && !(_class isEqualTo "")) then { switch (_method) do { case 0: { - _newObj setPosWorld _objectPos; - _newObj setVectorDirAndUp [vectordir _object, vectorup _object]; + _newObj setposATL (getPosATL _object); + _newObj setDir (getDir _object); + _newObj setVectorDirAndUp [vectorDir _object, vectorUP _object]; }; case 1: { _newObj attachTo [_object,[0,0,0]]; @@ -38,7 +39,7 @@ if (!isNull _object && !(_class isEqualTo "")) then { // force nearby players to reveal new object faster _playersNear = _newObj nearEntities[["Epoch_Male_F", "Epoch_Female_F"], 300]; { - [_x, _newObj] remoteExec ['reveal',_x]; + [_newObj, {player reveal _this}] remoteExec ["call", _x]; }forEach _playersNear; };