mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
More reliable freecam PFH termination
This commit is contained in:
parent
fb2b2bc9e5
commit
7b28214c80
@ -17,7 +17,7 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
// Kill PFH when not in free cam (or display is closed)
|
||||
if ((GVAR(camMode) != 0) || isNull (GETUVAR(GVAR(display),displayNull))) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; };
|
||||
if (isNil QGVAR(camHandler)) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; };
|
||||
|
||||
_oldPos = getPosASL GVAR(camera);
|
||||
_mX = 0;
|
||||
|
@ -135,6 +135,8 @@ switch (toLower _mode) do {
|
||||
with uiNamespace do {
|
||||
GVAR(display) = nil;
|
||||
};
|
||||
|
||||
GVAR(camHandler) = nil;
|
||||
};
|
||||
// Mouse events
|
||||
case "onmousebuttondown": {
|
||||
|
@ -23,7 +23,7 @@ if (GVAR(camMode) == 0) then { // Free
|
||||
cameraEffectEnableHUD false;
|
||||
|
||||
// Handle camera movement
|
||||
[FUNC(handleCamera), 0] call CBA_fnc_addPerFrameHandler;
|
||||
if (isNil QGVAR(camHandler)) then { GVAR(camHandler) = [FUNC(handleCamera), 0] call CBA_fnc_addPerFrameHandler; };
|
||||
} else {
|
||||
// When null unit is given choose random
|
||||
if (isNull _newUnit) then {
|
||||
@ -45,5 +45,6 @@ if (GVAR(camMode) == 0) then { // Free
|
||||
|
||||
// Terminate camera view
|
||||
GVAR(camera) cameraEffect ["terminate", "back"];
|
||||
GVAR(camHandler) = nil;
|
||||
cameraEffectEnableHUD true;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user