mirror of
https://github.com/EpochModTeam/Epoch.git
synced 2024-08-30 18:22:13 +00:00
setVectorDirAndUp after setpos
All uses of setVectorDirAndUp in arma code is after setpos not before.
This commit is contained in:
parent
dd031a6a7e
commit
d318d99a86
@ -72,9 +72,8 @@ if (!isNull _this) then {
|
|||||||
_class = getText(_cfgBaseBuilding >> _objClass >> "staticClass");
|
_class = getText(_cfgBaseBuilding >> _objClass >> "staticClass");
|
||||||
if (_class != "") then {
|
if (_class != "") then {
|
||||||
_newObj = createVehicle[_class, (_worldspace select 0), [], 0, "CAN_COLLIDE"];
|
_newObj = createVehicle[_class, (_worldspace select 0), [], 0, "CAN_COLLIDE"];
|
||||||
_newObj setVectorDirAndUp[_worldspace select 1, _worldspace select 2];
|
|
||||||
_newObj setposATL(_worldspace select 0);
|
_newObj setposATL(_worldspace select 0);
|
||||||
|
_newObj setVectorDirAndUp[_worldspace select 1, _worldspace select 2];
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
if (_saveCheck) then {
|
if (_saveCheck) then {
|
||||||
|
@ -80,8 +80,9 @@ if (isText(_simulClassConfig)) then {
|
|||||||
if (_objSlot != -1) then {
|
if (_objSlot != -1) then {
|
||||||
_newObj setVariable ["BUILD_SLOT",_objSlot,true];
|
_newObj setVariable ["BUILD_SLOT",_objSlot,true];
|
||||||
};
|
};
|
||||||
_newObj setVectorDirAndUp [_worldspace select 1,_worldspace select 2];
|
|
||||||
_newObj setposATL (_worldspace select 0);
|
_newObj setposATL (_worldspace select 0);
|
||||||
|
_newObj setVectorDirAndUp [_worldspace select 1,_worldspace select 2];
|
||||||
|
|
||||||
if (_textureSlot != 0) then {
|
if (_textureSlot != 0) then {
|
||||||
[_newObj, _textureSlot, player, Epoch_personalToken] remoteExec ["EPOCH_server_paintBUILD",2];
|
[_newObj, _textureSlot, player, Epoch_personalToken] remoteExec ["EPOCH_server_paintBUILD",2];
|
||||||
|
@ -216,10 +216,10 @@ if (_class != "") then {
|
|||||||
{
|
{
|
||||||
_nearestObject = _x;
|
_nearestObject = _x;
|
||||||
_isSnap = false;
|
_isSnap = false;
|
||||||
|
|
||||||
// Vector + Snapping
|
// Vector + Snapping
|
||||||
_snapMemoryPoint = "";
|
_snapMemoryPoint = "";
|
||||||
|
|
||||||
_snapPosition = [0, 0, 0];
|
_snapPosition = [0, 0, 0];
|
||||||
if (!isNull _nearestObject) then {
|
if (!isNull _nearestObject) then {
|
||||||
_snapConfig = _cfgBaseBuilding >> (typeOf _nearestObject);
|
_snapConfig = _cfgBaseBuilding >> (typeOf _nearestObject);
|
||||||
@ -242,7 +242,7 @@ if (_class != "") then {
|
|||||||
_isSnap = true;
|
_isSnap = true;
|
||||||
_snapPosition = _snapPos;
|
_snapPosition = _snapPos;
|
||||||
_snapType = _type;
|
_snapType = _type;
|
||||||
|
|
||||||
// Vector + Snapping
|
// Vector + Snapping
|
||||||
_snapMemoryPoint = _x;
|
_snapMemoryPoint = _x;
|
||||||
};
|
};
|
||||||
@ -275,11 +275,11 @@ if (_class != "") then {
|
|||||||
{
|
{
|
||||||
detach _x;
|
detach _x;
|
||||||
} forEach attachedObjects player;
|
} forEach attachedObjects player;
|
||||||
|
|
||||||
// Vector + Snapping
|
// Vector + Snapping
|
||||||
_vectorDir = vectorDir _nearestObject;
|
_vectorDir = vectorDir _nearestObject;
|
||||||
_vectorUp = vectorup _nearestObject;
|
_vectorUp = vectorup _nearestObject;
|
||||||
|
|
||||||
_dir2 = [_vectorDir, _direction] call BIS_fnc_returnVector;
|
_dir2 = [_vectorDir, _direction] call BIS_fnc_returnVector;
|
||||||
if (_pos2 select 2 > _maxHeight) then {
|
if (_pos2 select 2 > _maxHeight) then {
|
||||||
_pos2 set[2, _maxHeight];
|
_pos2 set[2, _maxHeight];
|
||||||
@ -287,9 +287,10 @@ if (_class != "") then {
|
|||||||
if (surfaceIsWater _snapPosition) then {
|
if (surfaceIsWater _snapPosition) then {
|
||||||
_snapPosition = ASLtoATL _snapPosition;
|
_snapPosition = ASLtoATL _snapPosition;
|
||||||
};
|
};
|
||||||
_currentTarget setVectorDirAndUp[_dir2, (vectorUp _nearestObject)];
|
|
||||||
_currentTarget setposATL _snapPosition;
|
_currentTarget setposATL _snapPosition;
|
||||||
|
_currentTarget setVectorDirAndUp[_dir2, (vectorUp _nearestObject)];
|
||||||
|
|
||||||
// Vector + Snapping
|
// Vector + Snapping
|
||||||
if(!(_vectorUp select 0 == 0) || !(_vectorUp select 1 == 0) || !(_vectorUp select 2 == 1)) then{
|
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)));
|
_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{
|
if( ((_tiltFB) && (_snapMemoryPoint in ["N","S"])) || ((_tiltLR) && (_snapMemoryPoint in ["W","E"])) )then{
|
||||||
EPOCH_tempTarget setVectorUp _vectorUp;
|
EPOCH_tempTarget setVectorUp _vectorUp;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
if(_snapType isEqualTo "para")then{
|
if(_snapType isEqualTo "para")then{
|
||||||
if((_tiltFB) && (EPOCH_snapDirection in [0,2]))then{
|
if((_tiltFB) && (EPOCH_snapDirection in [0,2]))then{
|
||||||
@ -317,12 +318,12 @@ if (_class != "") then {
|
|||||||
};
|
};
|
||||||
_newDir = vectorDir EPOCH_tempTarget;
|
_newDir = vectorDir EPOCH_tempTarget;
|
||||||
_vectorDir = _newDir;
|
_vectorDir = _newDir;
|
||||||
|
|
||||||
_currentTarget setposATL _snapPosition;
|
_currentTarget setposATL _snapPosition;
|
||||||
_currentTarget setDir ((getDir _currentTarget) + (EPOCH_snapDirection * 90));
|
_currentTarget setDir ((getDir _currentTarget) + (EPOCH_snapDirection * 90));
|
||||||
_currentTarget setVectorDirAndUp [_vectorDir,_vectorUP];
|
_currentTarget setVectorDirAndUp [_vectorDir,_vectorUP];
|
||||||
};
|
};
|
||||||
|
|
||||||
_snapped = true;
|
_snapped = true;
|
||||||
if(!isNil "EPOCH_tempTarget")then{
|
if(!isNil "EPOCH_tempTarget")then{
|
||||||
deleteVehicle EPOCH_tempTarget;
|
deleteVehicle EPOCH_tempTarget;
|
||||||
@ -408,8 +409,8 @@ if (_class != "") then {
|
|||||||
deleteVehicle _currentTarget;
|
deleteVehicle _currentTarget;
|
||||||
_currentTarget = createVehicle[_simulClass, (_worldspace select 0), [], 0, "CAN_COLLIDE"];
|
_currentTarget = createVehicle[_simulClass, (_worldspace select 0), [], 0, "CAN_COLLIDE"];
|
||||||
|
|
||||||
_currentTarget setVectorDirAndUp[_worldspace select 1, _worldspace select 2];
|
|
||||||
_currentTarget setposATL(_worldspace select 0);
|
_currentTarget setposATL(_worldspace select 0);
|
||||||
|
_currentTarget setVectorDirAndUp[_worldspace select 1, _worldspace select 2];
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -89,8 +89,8 @@ for "_i" from 0 to _this do {
|
|||||||
} foreach _IndestructibleBaseObjects;
|
} foreach _IndestructibleBaseObjects;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
_baseObj setVectorDirAndUp _worldspace;
|
|
||||||
_baseObj setposATL _location;
|
_baseObj setposATL _location;
|
||||||
|
_baseObj setVectorDirAndUp _worldspace;
|
||||||
|
|
||||||
// new Dynamicsimulation
|
// new Dynamicsimulation
|
||||||
if(["CfgDynamicSimulation", "baseDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntryV2)then
|
if(["CfgDynamicSimulation", "baseDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntryV2)then
|
||||||
@ -99,7 +99,7 @@ for "_i" from 0 to _this do {
|
|||||||
_baseObj enableDynamicSimulation true;
|
_baseObj enableDynamicSimulation true;
|
||||||
_baseObj triggerDynamicSimulation false; // this object doesnt need to turn anything on in the server
|
_baseObj triggerDynamicSimulation false; // this object doesnt need to turn anything on in the server
|
||||||
};
|
};
|
||||||
|
|
||||||
// spawn additional object for trap
|
// spawn additional object for trap
|
||||||
_ammoClass = (_cfgBaseBuilding >> _class >> "ammoClass");
|
_ammoClass = (_cfgBaseBuilding >> _class >> "ammoClass");
|
||||||
if(isText _ammoClass) then {
|
if(isText _ammoClass) then {
|
||||||
|
@ -56,8 +56,6 @@ if (_objSlot != -1) then {
|
|||||||
if (isText _ammoClass) then {
|
if (isText _ammoClass) then {
|
||||||
_ammoClass = getText _ammoClass;
|
_ammoClass = getText _ammoClass;
|
||||||
_ammoObj = createVehicle [_ammoClass, [0,0,0], [], 0, "CAN_COLLIDE"];
|
_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]];
|
_ammoObj attachTo [_newObj,[0,0,0]];
|
||||||
_newObj setVariable ["EPOCH_TRAP_OBJ",_ammoObj];
|
_newObj setVariable ["EPOCH_TRAP_OBJ",_ammoObj];
|
||||||
};
|
};
|
||||||
|
@ -9,18 +9,18 @@ if (!isNull _object && !(_class isEqualTo "")) then {
|
|||||||
_newObj = createVehicle [_class, ASLtoAGL _objectPos, [], 0, "CAN_COLLIDE"];
|
_newObj = createVehicle [_class, ASLtoAGL _objectPos, [], 0, "CAN_COLLIDE"];
|
||||||
if (!isNull _newObj) then {
|
if (!isNull _newObj) then {
|
||||||
_object hideObjectGlobal true;
|
_object hideObjectGlobal true;
|
||||||
|
|
||||||
// new Dynamicsimulation
|
// new Dynamicsimulation
|
||||||
if(["CfgDynamicSimulation", "baseDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntryV2)then
|
if(["CfgDynamicSimulation", "baseDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntryV2)then
|
||||||
{
|
{
|
||||||
_newObj enableDynamicSimulation true;
|
_newObj enableDynamicSimulation true;
|
||||||
_newObj triggerDynamicSimulation false; // this object doesnt need to turn anything on in the server
|
_newObj triggerDynamicSimulation false; // this object doesnt need to turn anything on in the server
|
||||||
};
|
};
|
||||||
|
|
||||||
switch (_method) do {
|
switch (_method) do {
|
||||||
case 0: {
|
case 0: {
|
||||||
_newObj setVectorDirAndUp [vectordir _object, vectorup _object];
|
|
||||||
_newObj setPosWorld _objectPos;
|
_newObj setPosWorld _objectPos;
|
||||||
|
_newObj setVectorDirAndUp [vectordir _object, vectorup _object];
|
||||||
};
|
};
|
||||||
case 1: {
|
case 1: {
|
||||||
_newObj attachTo [_object,[0,0,0]];
|
_newObj attachTo [_object,[0,0,0]];
|
||||||
|
@ -94,11 +94,11 @@ if !(_debugBox isEqualTo "") then {
|
|||||||
|
|
||||||
_ep allowDamage false;
|
_ep allowDamage false;
|
||||||
if (_dir isEqualType []) then{
|
if (_dir isEqualType []) then{
|
||||||
|
_ep setposATL _pos;
|
||||||
_ep setVectorDirAndUp _dir;
|
_ep setVectorDirAndUp _dir;
|
||||||
_ep setposATL _pos;
|
|
||||||
} else {
|
} else {
|
||||||
_ep setDir _dir;
|
|
||||||
_ep setposATL _pos;
|
_ep setposATL _pos;
|
||||||
|
_ep setDir _dir;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_deSimulate) then{
|
if (_deSimulate) then{
|
||||||
|
@ -85,11 +85,11 @@ for "_i" from 1 to _maxStorageLimit do {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (_dir isEqualType []) then {
|
if (_dir isEqualType []) then {
|
||||||
|
_vehicle setposATL _location;
|
||||||
_vehicle setVectorDirAndUp _dir;
|
_vehicle setVectorDirAndUp _dir;
|
||||||
_vehicle setposATL _location;
|
|
||||||
} else {
|
} else {
|
||||||
_vehicle setDir _dir;
|
|
||||||
_vehicle setposATL _location;
|
_vehicle setposATL _location;
|
||||||
|
_vehicle setDir _dir;
|
||||||
};
|
};
|
||||||
|
|
||||||
// temp set damage to mark for maint
|
// temp set damage to mark for maint
|
||||||
|
@ -115,8 +115,8 @@ for "_i" from 1 to _maxVehicleLimit do {
|
|||||||
_vehicle call EPOCH_server_setVToken;
|
_vehicle call EPOCH_server_setVToken;
|
||||||
_vehicle call EPOCH_server_vehicleInit;
|
_vehicle call EPOCH_server_vehicleInit;
|
||||||
// set final direction and postion of vehicle
|
// set final direction and postion of vehicle
|
||||||
_vehicle setVectorDirAndUp _worldspace;
|
|
||||||
_vehicle setposATL _location;
|
_vehicle setposATL _location;
|
||||||
|
_vehicle setVectorDirAndUp _worldspace;
|
||||||
|
|
||||||
// set fuel level
|
// set fuel level
|
||||||
_vehicle setFuel _fuel;
|
_vehicle setFuel _fuel;
|
||||||
|
@ -71,8 +71,8 @@ for "_i" from 1 to _maxVehicleLimit do {
|
|||||||
_vehicle = createVehicle [_class, _location, [], 0, "CAN_COLLIDE"];
|
_vehicle = createVehicle [_class, _location, [], 0, "CAN_COLLIDE"];
|
||||||
_allVehicles pushBack _vehicle;
|
_allVehicles pushBack _vehicle;
|
||||||
_vehicle call EPOCH_server_setVToken;
|
_vehicle call EPOCH_server_setVToken;
|
||||||
_vehicle setVectorDirAndUp _worldspace;
|
|
||||||
_vehicle setposATL _location;
|
_vehicle setposATL _location;
|
||||||
|
_vehicle setVectorDirAndUp _worldspace;
|
||||||
_vehicle setDamage _damage;
|
_vehicle setDamage _damage;
|
||||||
|
|
||||||
_allHitpoints = getAllHitPointsDamage _vehicle;
|
_allHitpoints = getAllHitPointsDamage _vehicle;
|
||||||
|
@ -38,11 +38,11 @@ if !(isNull _vehObj) then{
|
|||||||
|
|
||||||
// Set Direction and position
|
// Set Direction and position
|
||||||
if (_direction isEqualType []) then{
|
if (_direction isEqualType []) then{
|
||||||
|
_vehObj setposATL _position;
|
||||||
_vehObj setVectorDirAndUp _direction;
|
_vehObj setVectorDirAndUp _direction;
|
||||||
_vehObj setposATL _position;
|
|
||||||
} else {
|
} else {
|
||||||
_vehObj setdir _direction;
|
|
||||||
_vehObj setposATL _position;
|
_vehObj setposATL _position;
|
||||||
|
_vehObj setdir _direction;
|
||||||
};
|
};
|
||||||
// Normalize vehicle inventory
|
// Normalize vehicle inventory
|
||||||
clearWeaponCargoGlobal _vehObj;
|
clearWeaponCargoGlobal _vehObj;
|
||||||
|
@ -115,8 +115,8 @@ if (_status == 1 && _data isEqualType [] && !(_data isEqualTo [])) then {
|
|||||||
if (_x isEqualType [] && !(_x isEqualTo [])) then {
|
if (_x isEqualType [] && !(_x isEqualTo [])) then {
|
||||||
_x params ["_selectedDebris","_posWorld", "_vectorDir", "_vectorUp"];
|
_x params ["_selectedDebris","_posWorld", "_vectorDir", "_vectorUp"];
|
||||||
_object = createSimpleObject [_selectedDebris, _posWorld];
|
_object = createSimpleObject [_selectedDebris, _posWorld];
|
||||||
_object setVectorDirAndUp [_vectorDir,_vectorUp];
|
|
||||||
_object setPosWorld _posWorld;
|
_object setPosWorld _posWorld;
|
||||||
|
_object setVectorDirAndUp [_vectorDir,_vectorUp];
|
||||||
_debrisCounter = _debrisCounter + 1;
|
_debrisCounter = _debrisCounter + 1;
|
||||||
};
|
};
|
||||||
} forEach _debrisLocations;
|
} forEach _debrisLocations;
|
||||||
|
Loading…
Reference in New Issue
Block a user