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

pass old unit in 'unit' event, disable on HC and dedicated servers #332

Merged
merged 1 commit into from
May 18, 2016
Merged
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: 3 additions & 1 deletion addons/events/fnc_addPlayerEventHandler.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ Author:
#include "script_component.hpp"
SCRIPT(addPlayerEventHandler);

if (!hasInterface) exitWith {-1};

params [["_type", "", [""]], ["_function", {}, [{}]]];

_type = toLower _type;
Expand Down Expand Up @@ -82,8 +84,8 @@ if (_id != -1) then {
GVAR(playerEHInfo) pushBack addMissionEventHandler ["EachFrame", {
private _player = call CBA_fnc_currentUnit;
if !(_player isEqualTo GVAR(oldUnit)) then {
[QGVAR(unitEvent), [_player, GVAR(oldUnit)]] call CBA_fnc_localEvent;
GVAR(oldUnit) = _player;
[QGVAR(unitEvent), [_player]] call CBA_fnc_localEvent;
};

private _data = currentWeapon _player;
Expand Down