mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
8763184b6a
* Dragon work cleanup remove unused p3ds add pos_gunner_dir/pos_gunner to static add [csw] prefix to arsenal version add sight interaction icons * Update fnc_staticWeaponInit_unloadExtraMags.sqf * ace_rearm compat allows pulling carry mags out of rearm trucks * Update fnc_ai_handleFired.sqf * Re-add 3den attributes * cleanup and move A2 staticweapon strings to ace_csw
42 lines
1.6 KiB
Plaintext
42 lines
1.6 KiB
Plaintext
#include "script_component.hpp"
|
|
|
|
[QGVAR(detachSight), LINKFUNC(sightDetach)] call CBA_fnc_addEventHandler;
|
|
[QGVAR(attachSight), LINKFUNC(sightAttach)] call CBA_fnc_addEventHandler;
|
|
|
|
["vehicle", {
|
|
params ["","_vehicle"];
|
|
TRACE_2("vehicle change",_vehicle,typeOf _vehicle);
|
|
if (!(_vehicle isKindOf QGVAR(staticBase))) exitWith {};
|
|
|
|
_vehicle animate ["rest_rotate", 0];
|
|
|
|
if (isNil QGVAR(pfID)) then {GVAR(pfID) = -1};
|
|
[GVAR(pfID)] call CBA_fnc_removePerFrameHandler;
|
|
|
|
private _lastView = cameraView;
|
|
if (!(_lastView in ["INTERNAL", "EXTERNAL"])) then { _lastView == "INTERNAL"; };
|
|
|
|
GVAR(pfID) = [{
|
|
params ["_args"];
|
|
(_this select 0) params ["_vehicle", "_lastView"];
|
|
|
|
if ((!alive _vehicle) || {!alive ACE_player} || {(vehicle ACE_player) != _vehicle}) exitWith {
|
|
TRACE_1("exiting PFEH",GVAR(pfID));
|
|
[GVAR(pfID)] call CBA_fnc_removePerFrameHandler;
|
|
if ((alive _vehicle) && {!alive gunner _vehicle}) then {
|
|
TRACE_1("reseting rest rotate anim",_vehicle);
|
|
_vehicle animate ["rest_rotate", -0.35];
|
|
};
|
|
};
|
|
|
|
if (cameraView in ["INTERNAL", "EXTERNAL"]) then {
|
|
_args set [1, cameraView];
|
|
} else {
|
|
if ((cameraOn == _vehicle) && {!(_vehicle getVariable [QGVAR(sightAttached), ((typeOf _vehicle) == QGVAR(staticAssembled))])}) then {
|
|
_vehicle switchCamera _lastView;
|
|
};
|
|
};
|
|
}, 0, [_vehicle, _lastView]] call CBA_fnc_addPerFrameHandler;
|
|
TRACE_1("started PFEH",GVAR(pfID));
|
|
}, true] call CBA_fnc_addPlayerEventHandler;
|