ACE3/addons/explosives/functions/fnc_setPosition.sqf

32 lines
755 B
Plaintext
Raw Permalink Normal View History

#include "..\script_component.hpp"
/*
* Author: Garth 'L-H' de Wet
* Sets the Dir and pitch of passed object
*
* Arguments:
* 0: Explosive <OBJECT>
* 1: Direction <NUMBER>
* 2: Pitch <NUMBER>
*
* Return Value:
* None
*
* Example:
2015-07-17 04:59:31 +00:00
* [_explosive, 150, 90] call ACE_Explosives_fnc_setPosition;
*
* Public: No
*/
2015-07-17 04:59:31 +00:00
2015-08-15 19:35:33 +00:00
params ["_explosive", "_direction", "_pitch"];
TRACE_3("params",_explosive,_direction,_pitch);
2015-07-17 04:59:31 +00:00
if (isNull (attachedTo _explosive)) then {
_explosive setDir _direction;
if (_pitch != 0) then {
[_explosive, _pitch, 0] call CALLSTACK(BIS_fnc_setPitchBank);
};
} else {
//Attaching to a vehicle (dirAndUp based on vehicle)
2015-07-17 04:59:31 +00:00
_explosive setVectorDirAndUp [[0,0,1],[(sin _direction),(cos _direction),0]];
};