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"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
// Kill PFH when not in free cam (or display is closed)
|
// 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);
|
_oldPos = getPosASL GVAR(camera);
|
||||||
_mX = 0;
|
_mX = 0;
|
||||||
|
@ -135,6 +135,8 @@ switch (toLower _mode) do {
|
|||||||
with uiNamespace do {
|
with uiNamespace do {
|
||||||
GVAR(display) = nil;
|
GVAR(display) = nil;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
GVAR(camHandler) = nil;
|
||||||
};
|
};
|
||||||
// Mouse events
|
// Mouse events
|
||||||
case "onmousebuttondown": {
|
case "onmousebuttondown": {
|
||||||
|
@ -23,7 +23,7 @@ if (GVAR(camMode) == 0) then { // Free
|
|||||||
cameraEffectEnableHUD false;
|
cameraEffectEnableHUD false;
|
||||||
|
|
||||||
// Handle camera movement
|
// 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 {
|
} else {
|
||||||
// When null unit is given choose random
|
// When null unit is given choose random
|
||||||
if (isNull _newUnit) then {
|
if (isNull _newUnit) then {
|
||||||
@ -45,5 +45,6 @@ if (GVAR(camMode) == 0) then { // Free
|
|||||||
|
|
||||||
// Terminate camera view
|
// Terminate camera view
|
||||||
GVAR(camera) cameraEffect ["terminate", "back"];
|
GVAR(camera) cameraEffect ["terminate", "back"];
|
||||||
|
GVAR(camHandler) = nil;
|
||||||
cameraEffectEnableHUD true;
|
cameraEffectEnableHUD true;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user