From d318d99a86c6fbc73d26a8175b1de8b704be7bb8 Mon Sep 17 00:00:00 2001 From: vbawol Date: Mon, 25 Sep 2017 16:58:28 -0500 Subject: [PATCH] setVectorDirAndUp after setpos All uses of setVectorDirAndUp in arma code is after setpos not before. --- .../compile/building/EPOCH_countdown.sqf | 3 +-- .../compile/building/EPOCH_simulSwap.sqf | 3 ++- .../compile/building/EPOCH_staticMove.sqf | 23 ++++++++++--------- .../EPOCH_server_loadBuildings.sqf | 4 ++-- .../epoch_bases/EPOCH_server_simulSwap.sqf | 2 -- .../epoch_bases/EPOCH_swapBuilding.sqf | 6 ++--- .../EPOCH_server_createTeleport.sqf | 4 ++-- .../epoch_vehicle/EPOCH_load_storage.sqf | 4 ++-- .../epoch_vehicle/EPOCH_load_vehicles.sqf | 2 +- .../epoch_vehicle/EPOCH_load_vehicles_old.sqf | 2 +- .../epoch_vehicle/EPOCH_spawn_vehicle.sqf | 4 ++-- .../EpochEvents/DynamicDebris.sqf | 2 +- 12 files changed, 29 insertions(+), 30 deletions(-) diff --git a/Sources/epoch_code/compile/building/EPOCH_countdown.sqf b/Sources/epoch_code/compile/building/EPOCH_countdown.sqf index 7c2d925d..f0dbd74f 100644 --- a/Sources/epoch_code/compile/building/EPOCH_countdown.sqf +++ b/Sources/epoch_code/compile/building/EPOCH_countdown.sqf @@ -72,9 +72,8 @@ if (!isNull _this) then { _class = getText(_cfgBaseBuilding >> _objClass >> "staticClass"); if (_class != "") then { _newObj = createVehicle[_class, (_worldspace select 0), [], 0, "CAN_COLLIDE"]; - _newObj setVectorDirAndUp[_worldspace select 1, _worldspace select 2]; _newObj setposATL(_worldspace select 0); - + _newObj setVectorDirAndUp[_worldspace select 1, _worldspace select 2]; }; } else { if (_saveCheck) then { diff --git a/Sources/epoch_code/compile/building/EPOCH_simulSwap.sqf b/Sources/epoch_code/compile/building/EPOCH_simulSwap.sqf index fd54e67e..708fa9f8 100644 --- a/Sources/epoch_code/compile/building/EPOCH_simulSwap.sqf +++ b/Sources/epoch_code/compile/building/EPOCH_simulSwap.sqf @@ -80,8 +80,9 @@ if (isText(_simulClassConfig)) then { if (_objSlot != -1) then { _newObj setVariable ["BUILD_SLOT",_objSlot,true]; }; - _newObj setVectorDirAndUp [_worldspace select 1,_worldspace select 2]; + _newObj setposATL (_worldspace select 0); + _newObj setVectorDirAndUp [_worldspace select 1,_worldspace select 2]; if (_textureSlot != 0) then { [_newObj, _textureSlot, player, Epoch_personalToken] remoteExec ["EPOCH_server_paintBUILD",2]; diff --git a/Sources/epoch_code/compile/building/EPOCH_staticMove.sqf b/Sources/epoch_code/compile/building/EPOCH_staticMove.sqf index 12cfc593..407912dd 100644 --- a/Sources/epoch_code/compile/building/EPOCH_staticMove.sqf +++ b/Sources/epoch_code/compile/building/EPOCH_staticMove.sqf @@ -216,10 +216,10 @@ if (_class != "") then { { _nearestObject = _x; _isSnap = false; - + // Vector + Snapping _snapMemoryPoint = ""; - + _snapPosition = [0, 0, 0]; if (!isNull _nearestObject) then { _snapConfig = _cfgBaseBuilding >> (typeOf _nearestObject); @@ -242,7 +242,7 @@ if (_class != "") then { _isSnap = true; _snapPosition = _snapPos; _snapType = _type; - + // Vector + Snapping _snapMemoryPoint = _x; }; @@ -275,11 +275,11 @@ if (_class != "") then { { detach _x; } forEach attachedObjects player; - + // Vector + Snapping _vectorDir = vectorDir _nearestObject; _vectorUp = vectorup _nearestObject; - + _dir2 = [_vectorDir, _direction] call BIS_fnc_returnVector; if (_pos2 select 2 > _maxHeight) then { _pos2 set[2, _maxHeight]; @@ -287,9 +287,10 @@ if (_class != "") then { if (surfaceIsWater _snapPosition) then { _snapPosition = ASLtoATL _snapPosition; }; - _currentTarget setVectorDirAndUp[_dir2, (vectorUp _nearestObject)]; + _currentTarget setposATL _snapPosition; - + _currentTarget setVectorDirAndUp[_dir2, (vectorUp _nearestObject)]; + // Vector + Snapping if(!(_vectorUp select 0 == 0) || !(_vectorUp select 1 == 0) || !(_vectorUp select 2 == 1)) then{ _tiltFB = (((_vectorUp select 0 < 0) && (_vectorUp select 1 > 0)) || ((_vectorUp select 0 > 0) && (_vectorUp select 1 < 0))); @@ -305,7 +306,7 @@ if (_class != "") then { }; if( ((_tiltFB) && (_snapMemoryPoint in ["N","S"])) || ((_tiltLR) && (_snapMemoryPoint in ["W","E"])) )then{ EPOCH_tempTarget setVectorUp _vectorUp; - }; + }; }; if(_snapType isEqualTo "para")then{ if((_tiltFB) && (EPOCH_snapDirection in [0,2]))then{ @@ -317,12 +318,12 @@ if (_class != "") then { }; _newDir = vectorDir EPOCH_tempTarget; _vectorDir = _newDir; - + _currentTarget setposATL _snapPosition; _currentTarget setDir ((getDir _currentTarget) + (EPOCH_snapDirection * 90)); _currentTarget setVectorDirAndUp [_vectorDir,_vectorUP]; }; - + _snapped = true; if(!isNil "EPOCH_tempTarget")then{ deleteVehicle EPOCH_tempTarget; @@ -408,8 +409,8 @@ if (_class != "") then { deleteVehicle _currentTarget; _currentTarget = createVehicle[_simulClass, (_worldspace select 0), [], 0, "CAN_COLLIDE"]; - _currentTarget setVectorDirAndUp[_worldspace select 1, _worldspace select 2]; _currentTarget setposATL(_worldspace select 0); + _currentTarget setVectorDirAndUp[_worldspace select 1, _worldspace select 2]; }; }; diff --git a/Sources/epoch_server/compile/epoch_bases/EPOCH_server_loadBuildings.sqf b/Sources/epoch_server/compile/epoch_bases/EPOCH_server_loadBuildings.sqf index 5f7b9edd..5af4e8b3 100644 --- a/Sources/epoch_server/compile/epoch_bases/EPOCH_server_loadBuildings.sqf +++ b/Sources/epoch_server/compile/epoch_bases/EPOCH_server_loadBuildings.sqf @@ -89,8 +89,8 @@ for "_i" from 0 to _this do { } foreach _IndestructibleBaseObjects; }; }; - _baseObj setVectorDirAndUp _worldspace; _baseObj setposATL _location; + _baseObj setVectorDirAndUp _worldspace; // new Dynamicsimulation if(["CfgDynamicSimulation", "baseDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntryV2)then @@ -99,7 +99,7 @@ for "_i" from 0 to _this do { _baseObj enableDynamicSimulation true; _baseObj triggerDynamicSimulation false; // this object doesnt need to turn anything on in the server }; - + // spawn additional object for trap _ammoClass = (_cfgBaseBuilding >> _class >> "ammoClass"); if(isText _ammoClass) then { diff --git a/Sources/epoch_server/compile/epoch_bases/EPOCH_server_simulSwap.sqf b/Sources/epoch_server/compile/epoch_bases/EPOCH_server_simulSwap.sqf index b35e5374..e19a02d3 100644 --- a/Sources/epoch_server/compile/epoch_bases/EPOCH_server_simulSwap.sqf +++ b/Sources/epoch_server/compile/epoch_bases/EPOCH_server_simulSwap.sqf @@ -56,8 +56,6 @@ if (_objSlot != -1) then { if (isText _ammoClass) then { _ammoClass = getText _ammoClass; _ammoObj = createVehicle [_ammoClass, [0,0,0], [], 0, "CAN_COLLIDE"]; - //_ammoObj setVectorDirAndUp [(_worldspace select 1),(_worldspace select 2)]; - //_ammoObj setposATL (_worldspace select 0); _ammoObj attachTo [_newObj,[0,0,0]]; _newObj setVariable ["EPOCH_TRAP_OBJ",_ammoObj]; }; diff --git a/Sources/epoch_server/compile/epoch_bases/EPOCH_swapBuilding.sqf b/Sources/epoch_server/compile/epoch_bases/EPOCH_swapBuilding.sqf index bc207f70..570946ec 100644 --- a/Sources/epoch_server/compile/epoch_bases/EPOCH_swapBuilding.sqf +++ b/Sources/epoch_server/compile/epoch_bases/EPOCH_swapBuilding.sqf @@ -9,18 +9,18 @@ if (!isNull _object && !(_class isEqualTo "")) then { _newObj = createVehicle [_class, ASLtoAGL _objectPos, [], 0, "CAN_COLLIDE"]; if (!isNull _newObj) then { _object hideObjectGlobal true; - + // new Dynamicsimulation if(["CfgDynamicSimulation", "baseDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntryV2)then { _newObj enableDynamicSimulation true; _newObj triggerDynamicSimulation false; // this object doesnt need to turn anything on in the server }; - + switch (_method) do { case 0: { - _newObj setVectorDirAndUp [vectordir _object, vectorup _object]; _newObj setPosWorld _objectPos; + _newObj setVectorDirAndUp [vectordir _object, vectorup _object]; }; case 1: { _newObj attachTo [_object,[0,0,0]]; diff --git a/Sources/epoch_server/compile/epoch_server/EPOCH_server_createTeleport.sqf b/Sources/epoch_server/compile/epoch_server/EPOCH_server_createTeleport.sqf index 95141bfb..078fc706 100644 --- a/Sources/epoch_server/compile/epoch_server/EPOCH_server_createTeleport.sqf +++ b/Sources/epoch_server/compile/epoch_server/EPOCH_server_createTeleport.sqf @@ -94,11 +94,11 @@ if !(_debugBox isEqualTo "") then { _ep allowDamage false; if (_dir isEqualType []) then{ + _ep setposATL _pos; _ep setVectorDirAndUp _dir; - _ep setposATL _pos; } else { - _ep setDir _dir; _ep setposATL _pos; + _ep setDir _dir; }; if (_deSimulate) then{ diff --git a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_storage.sqf b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_storage.sqf index d5a6d23c..ae9e0bbd 100644 --- a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_storage.sqf +++ b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_storage.sqf @@ -85,11 +85,11 @@ for "_i" from 1 to _maxStorageLimit do { }; if (_dir isEqualType []) then { + _vehicle setposATL _location; _vehicle setVectorDirAndUp _dir; - _vehicle setposATL _location; } else { - _vehicle setDir _dir; _vehicle setposATL _location; + _vehicle setDir _dir; }; // temp set damage to mark for maint diff --git a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles.sqf b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles.sqf index f71c4697..4976e3db 100644 --- a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles.sqf +++ b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles.sqf @@ -115,8 +115,8 @@ for "_i" from 1 to _maxVehicleLimit do { _vehicle call EPOCH_server_setVToken; _vehicle call EPOCH_server_vehicleInit; // set final direction and postion of vehicle - _vehicle setVectorDirAndUp _worldspace; _vehicle setposATL _location; + _vehicle setVectorDirAndUp _worldspace; // set fuel level _vehicle setFuel _fuel; diff --git a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles_old.sqf b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles_old.sqf index a57682ca..3ff9398c 100644 --- a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles_old.sqf +++ b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles_old.sqf @@ -71,8 +71,8 @@ for "_i" from 1 to _maxVehicleLimit do { _vehicle = createVehicle [_class, _location, [], 0, "CAN_COLLIDE"]; _allVehicles pushBack _vehicle; _vehicle call EPOCH_server_setVToken; - _vehicle setVectorDirAndUp _worldspace; _vehicle setposATL _location; + _vehicle setVectorDirAndUp _worldspace; _vehicle setDamage _damage; _allHitpoints = getAllHitPointsDamage _vehicle; diff --git a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_spawn_vehicle.sqf b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_spawn_vehicle.sqf index 25e80990..a0657295 100644 --- a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_spawn_vehicle.sqf +++ b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_spawn_vehicle.sqf @@ -38,11 +38,11 @@ if !(isNull _vehObj) then{ // Set Direction and position if (_direction isEqualType []) then{ + _vehObj setposATL _position; _vehObj setVectorDirAndUp _direction; - _vehObj setposATL _position; } else { - _vehObj setdir _direction; _vehObj setposATL _position; + _vehObj setdir _direction; }; // Normalize vehicle inventory clearWeaponCargoGlobal _vehObj; diff --git a/Sources/epoch_server_debris_event/EpochEvents/DynamicDebris.sqf b/Sources/epoch_server_debris_event/EpochEvents/DynamicDebris.sqf index bc01fe6b..0af6da80 100644 --- a/Sources/epoch_server_debris_event/EpochEvents/DynamicDebris.sqf +++ b/Sources/epoch_server_debris_event/EpochEvents/DynamicDebris.sqf @@ -115,8 +115,8 @@ if (_status == 1 && _data isEqualType [] && !(_data isEqualTo [])) then { if (_x isEqualType [] && !(_x isEqualTo [])) then { _x params ["_selectedDebris","_posWorld", "_vectorDir", "_vectorUp"]; _object = createSimpleObject [_selectedDebris, _posWorld]; - _object setVectorDirAndUp [_vectorDir,_vectorUp]; _object setPosWorld _posWorld; + _object setVectorDirAndUp [_vectorDir,_vectorUp]; _debrisCounter = _debrisCounter + 1; }; } forEach _debrisLocations;