2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2021-10-14 15:46:43 +00:00
|
|
|
/*
|
|
|
|
* Author: Jonpas
|
|
|
|
* Ends mission on server if no players are connected.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [] call ace_headless_fnc_endMissionNoPlayers
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Exit if no players of virtual curators present
|
|
|
|
if (call CBA_fnc_players isEqualTo [] && {(allCurators select {isPlayer getAssignedCuratorUnit _x}) isEqualTo []}) exitWith {
|
|
|
|
// End mission
|
|
|
|
[] call BIS_fnc_endMissionServer;
|
|
|
|
if (XGVAR(log)) then {
|
|
|
|
INFO("Ended Mission on all players leaving.");
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
// Delay mission end otherwise
|
|
|
|
GVAR(endMissionCheckDelayed) = false;
|
|
|
|
TRACE_2("Players are present",count (call CBA_fnc_players),count allCurators);
|