ACE3/addons/common/functions/fnc_muteUnitHandleRespawn.sqf
jonpas 742626ff1a
General - Relative script_component.hpp includes (#9378)
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2023-09-12 20:58:10 +02:00

25 lines
696 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: commy2
* Applies speaker changes on respawn. Used because speaker is respawning breaks the speaker on non-local clients. Also resets the public object variable (broken for JIP clients, that join after respawn)
*
* Arguments:
* 0: unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [bob] call ace_common_fnc_muteUnitHandleRespawn
*
* Public: No
*/
params ["_unit"];
// setVariable is broken on JIP after respawn
_unit setVariable [QGVAR(muteUnitReasons), _unit getVariable [QGVAR(muteUnitReasons), []], true];
// fix mp issues with respawning and the speaker
[QGVAR(setSpeaker), [_unit, speaker _unit]] call CBA_fnc_globalEvent;