ACE3/addons/spectator/XEH_postInit.sqf
SilentSpike b1dda86cb2 End spectator interface when the mission ends
Fixes #2592 (in theory) by forcing spectator closed on mission end
2015-10-04 18:17:01 +01:00

14 lines
592 B
Plaintext

#include "script_component.hpp"
//#include "initKeybinds.sqf";
// Add interaction menu exception
["isNotSpectating", {!(GETVAR((_this select 0),GVAR(isStaged),false))}] call EFUNC(common,addCanInteractWithCondition);
["SettingsInitialized", {
GVAR(availableModes) = [[0,1,2], [1,2], [0], [1], [2]] select GVAR(restrictModes);
GVAR(availableVisions) = [[-2,-1,0,1], [-2,-1], [-2,0,1], [-2]] select GVAR(restrictVisions);
}] call EFUNC(common,addEventHandler);
// Should prevent unending spectator on mission end
addMissionEventHandler ["Ended",{ [false] call FUNC(setSpectator) }];