Add PFH to throw the playerInventoryChanged ACE event

This commit is contained in:
Nicolás Badano 2015-01-16 15:28:37 -03:00
parent 8467013c1a
commit 8b3c70a16d

View File

@ -74,4 +74,15 @@ enableCamShake true;
};
}] call FUNC(addEventhandler);
GVAR(OldPlayerInventory) = ACE_player call FUNC(getAllGear);
// PFH to raise "playerInventoryChanged" event
[{
_newPlayerInventory = ACE_player call FUNC(getAllGear);
if !(_newPlayerInventory isEqualTo GVAR(OldPlayerInventory)) exitWith {
// Raise ACE event
GVAR(OldPlayerInventory) = _newPlayerInventory;
["playerInventoryChanged", [ACE_player, _newPlayerInventory]] call FUNC(localEvent);
};
}, 0, []] call cba_fnc_addPerFrameHandler;