From 56f4cbb39e39c42397d73d938f7b30fc0cedd583 Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 18 Sep 2015 23:03:35 +0200 Subject: [PATCH 1/2] fix playerInventoryChanged eventhandler triggers when current weapon is changed fix #2513 --- addons/common/functions/fnc_getAllGear.sqf | 7 ++----- addons/respawn/functions/fnc_handleKilled.sqf | 1 + 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/addons/common/functions/fnc_getAllGear.sqf b/addons/common/functions/fnc_getAllGear.sqf index 33c23c98a3..aa2289309e 100644 --- a/addons/common/functions/fnc_getAllGear.sqf +++ b/addons/common/functions/fnc_getAllGear.sqf @@ -18,7 +18,6 @@ * 14-16: pistol (String, Array, Array) * 17: map, compass, watch, etc. (Array) * 18: binocluar (String) - * 19: active weapon, active muzzle, active weaponMode (Array) * */ #include "script_component.hpp" @@ -35,8 +34,7 @@ if (isNull _unit) exitWith {[ "", ["","","",""], [], "", ["","","",""], [], [], - "", - ["","",""] + "" ]}; [ @@ -49,6 +47,5 @@ if (isNull _unit) exitWith {[ secondaryWeapon _unit, secondaryWeaponItems _unit, secondaryWeaponMagazine _unit, handgunWeapon _unit, handgunItems _unit, handgunMagazine _unit, assignedItems _unit, - binocular _unit, - [currentWeapon _unit, currentMuzzle _unit, currentWeaponMode _unit] + binocular _unit ] diff --git a/addons/respawn/functions/fnc_handleKilled.sqf b/addons/respawn/functions/fnc_handleKilled.sqf index 1fea488421..84b84e20cd 100644 --- a/addons/respawn/functions/fnc_handleKilled.sqf +++ b/addons/respawn/functions/fnc_handleKilled.sqf @@ -25,6 +25,7 @@ if (ACE_player == _killedUnit) then { if (GVAR(SavePreDeathGear)) then { GVAR(unitGear) = [_killedUnit] call EFUNC(common,getAllGear); + GVAR(unitGear) append [currentWeapon _killedUnit, currentMuzzle _killedUnit, currentWeaponMode _killedUnit]; }; }; From 30ba4f55862bfa2a7cf2e8d268b29851eb8c8648 Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 18 Sep 2015 23:34:49 +0200 Subject: [PATCH 2/2] this append should've been pushBack --- addons/respawn/functions/fnc_handleKilled.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/respawn/functions/fnc_handleKilled.sqf b/addons/respawn/functions/fnc_handleKilled.sqf index 84b84e20cd..99ec308c1c 100644 --- a/addons/respawn/functions/fnc_handleKilled.sqf +++ b/addons/respawn/functions/fnc_handleKilled.sqf @@ -25,7 +25,7 @@ if (ACE_player == _killedUnit) then { if (GVAR(SavePreDeathGear)) then { GVAR(unitGear) = [_killedUnit] call EFUNC(common,getAllGear); - GVAR(unitGear) append [currentWeapon _killedUnit, currentMuzzle _killedUnit, currentWeaponMode _killedUnit]; + GVAR(unitGear) pushBack [currentWeapon _killedUnit, currentMuzzle _killedUnit, currentWeaponMode _killedUnit]; }; };