From a1f56f9080c155801525a07648efdea84b0ab588 Mon Sep 17 00:00:00 2001 From: "[VB]AWOL" Date: Sun, 29 Jun 2014 01:57:58 -0500 Subject: [PATCH] make sure holder is not null --- SQF/dayz_code/init/object_BackpackAction.sqf | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/SQF/dayz_code/init/object_BackpackAction.sqf b/SQF/dayz_code/init/object_BackpackAction.sqf index bb0ccdc1f..5be70db1b 100644 --- a/SQF/dayz_code/init/object_BackpackAction.sqf +++ b/SQF/dayz_code/init/object_BackpackAction.sqf @@ -6,12 +6,13 @@ _classname = _this select 2; // Exit if player zombie if(player isKindOf "PZombie_VB") exitWith {}; -_name = getText (configFile >> _type >> _classname >> "displayName"); +if (!isNull _holder) then { + _name = getText(configFile >> _type >> _classname >> "displayName"); + _actionSet = _holder getVariable["actionSet", false]; -_actionSet = _holder getVariable["actionSet", false]; - -if (!_actionSet) then { - s_player_holderPickup = _holder addAction [format[(localize "STR_DAYZ_CODE_1"),_name], "\z\addons\dayz_code\actions\object_pickup.sqf",[_type,_classname,_holder], 20, true, true]; - player reveal _holder; - _holder setVariable["actionSet", true]; + if (!_actionSet) then { + s_player_holderPickup = _holder addAction [format[(localize "STR_DAYZ_CODE_1"),_name], "\z\addons\dayz_code\actions\object_pickup.sqf",[_type,_classname,_holder], 20, true, true]; + player reveal _holder; + _holder setVariable["actionSet", true]; + }; }; \ No newline at end of file