Skip to content

Commit 7f0a7b8

Browse files
Mike-MFjonpas
andauthored
Mission - Improve Players function (#779)
Co-authored-by: jonpas <jonpas33@gmail.com>
1 parent 32293b6 commit 7f0a7b8

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

addons/mission/functions/fnc_players.sqf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#include "..\script_component.hpp"
22
/*
33
* Author: Mike
4-
* Wrapper of CBA_fnc_players, removing players in spectator
5-
* and optionally any units not touching the ground (eg. in the air/water).
4+
* Gets all players and excludes spectators & headless clients, optionally skipping any units not touching the ground (eg. in the air/water).
5+
* Mimics CBA_fnc_players using allPlayers instead of allUnits + allDeadMen and filtering for isPlayer
66
*
77
* Arguments:
88
* 0: Skip units not touching the ground <BOOL>
@@ -17,7 +17,7 @@
1717

1818
params [["_skipNotGround", false]];
1919

20-
private _players = (call CBA_fnc_players) select {!(_x getVariable [QACEGVAR(spectator,isSet), false])};
20+
private _players = (allPlayers - entities "HeadlessClient_F") select {!(_x getVariable [QACEGVAR(spectator,isSet), false])};
2121

2222
if (_skipNotGround) then {
2323
_players = _players select {isTouchingGround (vehicle _x)}; // Check vehicle, not the unit

0 commit comments

Comments
 (0)