Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Events - fix loadout player event args #1301

Merged
merged 4 commits into from Mar 13, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions addons/events/fnc_addPlayerEventHandler.sqf
Expand Up @@ -113,7 +113,7 @@ private _id = switch (_type) do {
};
case "featurecamera": {
if (_applyRetroactively) then {
[GVAR(oldUnit), call CBA_fnc_getActiveFeatureCamera] call _function;
[GVAR(oldUnit), call CBA_fnc_getActiveFeatureCamera, ""] call _function;
commy2 marked this conversation as resolved.
Show resolved Hide resolved
};
[QGVAR(featureCameraEvent), _function] call CBA_fnc_addEventHandler // return id
};
Expand All @@ -125,13 +125,13 @@ private _id = switch (_type) do {
};
case "group": {
if (_applyRetroactively) then {
[GVAR(oldUnit), group GVAR(oldUnit), grpNull] call _function;
[GVAR(oldUnit), grpNull, group GVAR(oldUnit)] call _function; // intentionally reversed order for backwards compatiblity
};
[QGVAR(groupEvent), _function] call CBA_fnc_addEventHandler // return id
};
case "leader": {
if (_applyRetroactively) then {
[GVAR(oldUnit), leader GVAR(oldUnit), objNull] call _function;
[GVAR(oldUnit), objNull, leader GVAR(oldUnit)] call _function; // intentionally reversed order for backwards compatiblity
commy2 marked this conversation as resolved.
Show resolved Hide resolved
};
[QGVAR(leaderEvent), _function] call CBA_fnc_addEventHandler // return id
};
Expand Down
6 changes: 3 additions & 3 deletions addons/events/fnc_playerEvent.sqf
Expand Up @@ -71,12 +71,12 @@ if !(_state isEqualTo GVAR(oldState)) then {
};

if !(_newGroup isEqualTo GVAR(oldGroup)) then {
[QGVAR(groupEvent), [_unit, GVAR(oldGroup), _newGroup]] call CBA_fnc_localEvent;
[QGVAR(groupEvent), [_unit, GVAR(oldGroup), _newGroup]] call CBA_fnc_localEvent; // intentionally reversed order for backwards compatiblity
GVAR(oldGroup) = _newGroup;
};

if !(_newLeader isEqualTo GVAR(oldLeader)) then {
[QGVAR(leaderEvent), [_unit, GVAR(oldLeader), _newLeader]] call CBA_fnc_localEvent;
[QGVAR(leaderEvent), [_unit, GVAR(oldLeader), _newLeader]] call CBA_fnc_localEvent; // intentionally reversed order for backwards compatiblity
GVAR(oldLeader) = _newLeader;
};

Expand Down Expand Up @@ -113,7 +113,7 @@ if !(_state isEqualTo GVAR(oldState)) then {
} forEach [primaryWeaponMagazine _unit, secondaryWeaponMagazine _unit, handgunMagazine _unit];

if !(_newLoadoutNoAmmo isEqualTo GVAR(oldLoadoutNoAmmo)) then {
[QGVAR(loadoutEvent), [_unit, GVAR(oldLoadout), _newLoadout]] call CBA_fnc_localEvent;
[QGVAR(loadoutEvent), [_unit, _newLoadout, GVAR(oldLoadout)]] call CBA_fnc_localEvent;
commy2 marked this conversation as resolved.
Show resolved Hide resolved
GVAR(oldLoadoutNoAmmo) = _newLoadoutNoAmmo;
};

Expand Down