2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2018-02-26 18:23:47 +00:00
|
|
|
/*
|
|
|
|
* Author: Dystopian
|
|
|
|
* Checks if vehicle can be flipped.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Vehicle <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* Can Flip <BOOL>
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [cursorObject] call ace_interaction_fnc_canFlip
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
params ["_vehicle"];
|
|
|
|
|
|
|
|
// most suitable mass for all vanilla, CUP and RHS statics ATM (ZU-23 suits, D-30 and M119 don't suit)
|
|
|
|
#define FLIP_MAX_STATICWEAPON_MASS 2000
|
|
|
|
|
|
|
|
1 < (vectorUp _vehicle) vectorDistance (surfaceNormal getPosATL _vehicle)
|
|
|
|
&& {0 == {alive _x} count crew _vehicle || {isAutonomous _vehicle}}
|
|
|
|
&& {getMass _vehicle <= FLIP_MAX_STATICWEAPON_MASS}
|