mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
don't do 'playerInventoryChanged' just because ammo decreased after firing
This commit is contained in:
parent
c5275813a4
commit
e4c86a8af5
@ -334,6 +334,7 @@ GVAR(OldPlayerVehicle) = vehicle objNull;
|
||||
GVAR(OldPlayerTurret) = [objNull] call FUNC(getTurretIndex);
|
||||
GVAR(OldPlayerWeapon) = currentWeapon objNull;
|
||||
GVAR(OldPlayerInventory) = [];
|
||||
GVAR(OldPlayerInventoryNoAmmo) = [];
|
||||
GVAR(OldPlayerVisionMode) = currentVisionMode objNull;
|
||||
GVAR(OldCameraView) = "";
|
||||
GVAR(OldVisibleMap) = false;
|
||||
@ -385,7 +386,19 @@ GVAR(OldIsCamera) = false;
|
||||
if !(_data isEqualTo GVAR(OldPlayerInventory)) then {
|
||||
// Raise ACE event locally
|
||||
GVAR(OldPlayerInventory) = _data;
|
||||
["playerInventoryChanged", [ACE_player, _data]] call FUNC(localEvent);
|
||||
|
||||
// we don't want to trigger this just because your ammo counter decreased.
|
||||
_data = + GVAR(OldPlayerInventory);
|
||||
(_data param [0, []]) set [4, primaryWeaponMagazine ACE_player];
|
||||
(_data param [0, []]) set [5, nil];
|
||||
(_data param [1, []]) set [4, secondaryWeaponMagazine ACE_player];
|
||||
(_data param [1, []]) set [5, nil];
|
||||
(_data param [2, []]) set [4, handgunMagazine ACE_player];
|
||||
(_data param [2, []]) set [5, nil];
|
||||
if !(_data isEqualTo GVAR(OldPlayerInventoryNoAmmo)) then {
|
||||
GVAR(OldPlayerInventoryNoAmmo) = _data;
|
||||
["playerInventoryChanged", [ACE_player, GVAR(OldPlayerInventory)]] call FUNC(localEvent);
|
||||
};
|
||||
};
|
||||
|
||||
// "playerVisionModeChanged" event
|
||||
|
Loading…
Reference in New Issue
Block a user