Fix spectator camera exiting mechanism

When using ACE_Player the camera would return to the dead body. It makes sense to simply pass the reset unit by reference to the camera exit code.
This commit is contained in:
SilentSpike 2015-08-03 13:04:36 +01:00
parent 98b088f26f
commit f5e7185aec
2 changed files with 4 additions and 2 deletions

View File

@ -57,6 +57,8 @@ switch (toLower _mode) do {
}; };
}; };
case "close": { case "close": {
_args params ["_unit"];
// Can't close a second time // Can't close a second time
if !(GVAR(open)) exitWith {}; if !(GVAR(open)) exitWith {};
GVAR(open) = false; GVAR(open) = false;
@ -71,7 +73,7 @@ switch (toLower _mode) do {
camDestroy GVAR(camera); camDestroy GVAR(camera);
// Return to player view // Return to player view
ACE_Player switchCamera "internal"; _unit switchCamera "internal";
// Cleanup camera variables // Cleanup camera variables
GVAR(camera) = nil; GVAR(camera) = nil;

View File

@ -36,7 +36,7 @@ if !(local _unit) exitwith {
if (_set) then { if (_set) then {
["open"] call FUNC(handleInterface); ["open"] call FUNC(handleInterface);
} else { } else {
["close"] call FUNC(handleInterface); ["close",_unit] call FUNC(handleInterface);
}; };
// Handle common addon audio // Handle common addon audio