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 all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions addons/events/fnc_addPlayerEventHandler.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@ private _id = switch (_type) do {
};
case "group": {
if (_applyRetroactively) then {
[GVAR(oldUnit), group GVAR(oldUnit), grpNull] call _function;
[GVAR(oldUnit), GVAR(oldGroup), GVAR(oldGroup)] call _function; // 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), GVAR(oldLeader), GVAR(oldLeader)] call _function; //backwards compatiblity
};
[QGVAR(leaderEvent), _function] call CBA_fnc_addEventHandler // return id
};
Expand Down
6 changes: 3 additions & 3 deletions addons/events/fnc_playerEvent.sqf
Original file line number Diff line number Diff line change
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