mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Allow resetting existing spectators
This commit is contained in:
parent
9026db9b3c
commit
788c23c940
@ -21,7 +21,8 @@ _unit = player;
|
||||
_target = _this select 0;
|
||||
_set = if (count _this > 1) then {_this select 1} else {true};
|
||||
|
||||
if (_set isEqualTo (_unit getVariable [QGVAR(isSpectator), false])) exitWith {};
|
||||
// No change, no service (but allow spectators who respawn to be reset)
|
||||
if !(_set || (_unit getVariable [QGVAR(isSpectator), false])) exitWith {};
|
||||
|
||||
// Prevent player falling into water
|
||||
_unit enableSimulation !_set;
|
||||
@ -67,7 +68,10 @@ if (["task_force_radio"] call EFUNC(common,isModLoaded)) then {[_unit, _set] cal
|
||||
_unit allowDamage !_set;
|
||||
_unit setVariable [QEGVAR(medical,allowDamage), !_set];
|
||||
|
||||
// Mark spectator state for external reference
|
||||
_unit setVariable [QGVAR(isSpectator), _set];
|
||||
// No theoretical change if an existing spectator was reset
|
||||
if !(_set && (_unit getVariable [QGVAR(isSpectator), false])) then {
|
||||
// Mark spectator state for reference
|
||||
_unit setVariable [QGVAR(isSpectator), _set];
|
||||
|
||||
["spectatorChanged",[_set]] call EFUNC(common,localEvent);
|
||||
["spectatorChanged",[_set]] call EFUNC(common,localEvent);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user