2015-01-18 06:56:09 +00:00
|
|
|
/*
|
2015-03-10 16:18:21 +00:00
|
|
|
* Author: commy2
|
2015-01-18 06:56:09 +00:00
|
|
|
*
|
2015-03-10 16:18:21 +00:00
|
|
|
* Handle the open inventory event. Display message on traget client.
|
2015-08-04 23:12:55 +00:00
|
|
|
*
|
2015-01-18 06:56:09 +00:00
|
|
|
* Argument:
|
|
|
|
* Input from "InventoryOpened" eventhandler
|
2015-08-04 23:12:55 +00:00
|
|
|
*
|
2015-01-18 06:56:09 +00:00
|
|
|
* Return value:
|
2015-03-10 16:18:21 +00:00
|
|
|
* false. Always open the inventory dialog. (Bool)
|
2015-01-18 06:56:09 +00:00
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-08-04 23:12:55 +00:00
|
|
|
private "_target";
|
|
|
|
params ["","_backpack"];
|
2015-01-18 06:56:09 +00:00
|
|
|
|
2015-03-10 16:18:21 +00:00
|
|
|
// exit if the target is not a backpack
|
|
|
|
if !([_backpack] call FUNC(isBackpack)) exitWith {};
|
2015-01-18 06:56:09 +00:00
|
|
|
|
2015-03-10 16:18:21 +00:00
|
|
|
// get the unit that wears the backpack object
|
2015-08-04 23:12:55 +00:00
|
|
|
_target = _this call FUNC(getBackpackAssignedUnit);
|
2015-01-18 06:56:09 +00:00
|
|
|
|
2015-08-04 23:12:55 +00:00
|
|
|
if (isNull _target) exitWith {false};
|
2015-03-10 16:18:21 +00:00
|
|
|
// raise event on target unit
|
2015-08-04 23:12:55 +00:00
|
|
|
["backpackOpened", _target, [_target, _backpack]] call EFUNC(common,targetEvent);
|
2015-01-18 06:56:09 +00:00
|
|
|
|
2015-03-10 16:18:21 +00:00
|
|
|
// return false to open inventory as usual
|
|
|
|
false
|