ACE3/addons/map/XEH_postInitServer.sqf
voiper d5b3b03c1c Make flashlight on/off + glow a PVAR.
Clean up all privates.
Change glow proxies to not inherit from chemlight_base, to avoid ammo detection issues.
Make handleDisconnect glow deletion dedi server compatible (was only listen server compatible).
Clean up determineMapLight: faster when no chemlights nearby, a tad slower when chemlights nearby, however sources the colour settings directly from the chemlight's config.
2016-06-17 17:18:06 -07:00

16 lines
481 B
Plaintext

#include "script_component.hpp"
// Delete map glow lights from disconnecting players, #2810
addMissionEventHandler ["HandleDisconnect",{
params ["_disconnectedPlayer"];
if (!GVAR(mapGlow)) exitWith {};
private _unitLight = _disconnectedPlayer getVariable [QGVAR(flashlight), ["", objNull]];
_unitLight params ["", "_glow"];
if ((!isNull _disconnectedPlayer) && {!isNull _glow}) then {
detach _glow;
deleteVehicle _glow;
};
nil
}];