Skip to content

Commit

Permalink
Added better handling for offline checks on player logging to prevent…
Browse files Browse the repository at this point in the history
… empty object (#1222)
  • Loading branch information
AndreasBrostrom authored Aug 2, 2024
1 parent bf28fc7 commit a830fac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cScripts/functions/init/fn_init_eventHandlers.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ INFO("InitEventHandlers","Creating Server EventHandlers");
params ["_guid","_name"];
private _unit = [_guid] call BIS_fnc_getUnitByUID;
private _playerLog = GETMVAR(EGVAR(log,players),createHashMap);
INFO_3("PlayerLog","Connected %1 [%2] (GUID: %3)",_name,typeOf _unit,_guid);
INFO_3("PlayerLog","Connected %1 [%2] (GUID: %3)",_name,_unit,_guid);

if (!isNil{_playerLog get _guid}) then {
INFO_1("PlayerLog","Updating Log Entry [%1]", isNil{_playerLog get _guid});
Expand All @@ -53,8 +53,8 @@ INFO("InitEventHandlers","Creating Server EventHandlers");
_connections pushBack systemTimeUTC;
_data set ["connections", _connections];

private _loadout = GETVAR(EGVAR(Gear,LoadoutClass), typeOf _unit);
_data set ["loadout", GETVAR(EGVAR(Gear,LoadoutClass), typeOf _unit)];
private _loadout = if (isNull _unit) then {"Trooper"} else {GETVAR(_unit,EGVAR(Gear,LoadoutClass), typeOf _unit)};
_data set ["loadout", _loadout];

_playerLog set [_guid,_data];
} else {
Expand Down

0 comments on commit a830fac

Please sign in to comment.