setVectorDirAndUp after setpos

All uses of setVectorDirAndUp in arma code is after setpos not before.
This commit is contained in:
vbawol 2017-09-25 16:58:28 -05:00
parent dd031a6a7e
commit d318d99a86
12 changed files with 29 additions and 30 deletions

View File

@ -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 {

View File

@ -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];

View File

@ -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];
};
};

View File

@ -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 {

View File

@ -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];
};

View File

@ -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]];

View File

@ -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{

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;