Skip to content

Commit

Permalink
Spectator - Fix players being invincible while in spectator mode (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
veteran29 authored Feb 6, 2022
1 parent 9416784 commit 98109b8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions addons/spectator/functions/fnc_start.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,13 @@ if (_civilianSide) then {
_whitelistedSides pushBack CIVILIAN;
};

// EG spectator disables player damage on init,
// save allowDamage state to restore it after spectator is opened.
private _allowDamage = isDamageAllowed player;

// Start spectator
["Initialize", [player, _whitelistedSides, _allowAI, _freeCamera, _TPPCamera, true, true, true, true, true]] call BIS_fnc_EGSpectator;
player allowDamage _allowDamage;
WARNING("Starting spectator!");

nil

0 comments on commit 98109b8

Please sign in to comment.