ACE3/addons/sitting/functions/fnc_hasChairMoved.sqf

31 lines
747 B
Plaintext
Raw Normal View History

/*
* Author: Jonpas
* Checks if chair moved from original position.
*
* Arguments:
* 0: Seat <OBJECT>
* 1: Seat Position <ARRAY>
*
* Return Value:
* None
*
* Example:
2015-08-07 13:12:24 +00:00
* [seat, seatPos] call ace_sitting_fnc_hasChairMoved
*
* Public: No
*/
#include "script_component.hpp"
2015-08-07 13:12:24 +00:00
params ["_seat", "_seatPosOrig"];
TRACE_2("Chair position",_seatPosOrig,getPosASL _seat);
2015-08-07 13:12:24 +00:00
(getPosASL _seat) params ["_seatX", "_seatY", "_seatZ"];
_seatPosOrig params ["_seatOrigX", "_seatOrigY", "_seatOrigZ"];
// Check each coordinate due to possibility of tiny movements in simulation
2015-08-07 13:12:24 +00:00
if (abs (_seatX - _seatOrigX) > 0.01) exitWith {true};
if (abs (_seatY - _seatOrigY) > 0.01) exitWith {true};
if (abs (_seatZ - _seatOrigZ) > 0.01) exitWith {true};
false