mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
31 lines
814 B
Plaintext
31 lines
814 B
Plaintext
/*
|
|
* Author: Commy2
|
|
* Handle "take" event
|
|
* I think it fixs jams when manually dragging a new magazine in from player's inventory
|
|
*
|
|
* Arguments:
|
|
* 0: unit - Object the event handler is assigned to <OBJECT>
|
|
* 1: container <OBJECT>
|
|
* 2: item <STRING>
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Public: No
|
|
*/
|
|
#include "script_component.hpp"
|
|
|
|
if !(GVAR(unJamOnreload)) exitWith {};
|
|
|
|
params ["_unit", "_container", "_item"];
|
|
TRACE_3("params",_unit,_container,_item);
|
|
|
|
if ((_unit == ACE_player)
|
|
&& {_container in [uniformContainer _unit, vestContainer _unit, backpackContainer _unit]}
|
|
&& {_item == currentMagazine _unit}) then { //Todo: should this be any valid magazine for any jammed gun?
|
|
|
|
TRACE_1("clearing jam",currentWeapon _unit);
|
|
[_unit, currentWeapon _unit, true] call FUNC(clearJam)
|
|
|
|
};
|