From 5b4d53d3b9de9008e653459c21f9e18319c53b2b Mon Sep 17 00:00:00 2001 From: deadeye2 Date: Wed, 20 Aug 2014 19:58:43 -0400 Subject: [PATCH] Update player_drink.sqf eliminate redundant declaring of _itemtodrop and change to match player_eat.sqf --- SQF/dayz_code/actions/player_drink.sqf | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/SQF/dayz_code/actions/player_drink.sqf b/SQF/dayz_code/actions/player_drink.sqf index dd2d5d8d1..3eb937d81 100644 --- a/SQF/dayz_code/actions/player_drink.sqf +++ b/SQF/dayz_code/actions/player_drink.sqf @@ -48,31 +48,26 @@ if (["ItemSoda",_itemorignal] call fnc_inString) then { [player,_dis,true,(getPosATL player)] spawn player_alertZombies; }; -if (_hasoutput) then{ - _itemtodrop = drink_output select(drink_with_output find _itemorignal); +if (_hasoutput) then { + // Selecting output + _itemtodrop = drink_output select (drink_with_output find _itemorignal); if (!_invehicle) then { - // Selecting output - _itemtodrop = drink_output select (drink_with_output find _itemorignal); - sleep 3; - _nearByPile= nearestObjects [(getPosATL player), ["WeaponHolder","WeaponHolderBase"],2]; - if (count _nearByPile ==0) then { + _nearByPile = nearestObjects [(getPosATL player), ["WeaponHolder","WeaponHolderBase"],2]; + if (count _nearByPile == 0) then { _iPos = getPosATL player; _radius = 0.0; _item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"]; - _item setposATL _iPos; + _item setPosATL _iPos; } else { _item = _nearByPile select 0; }; _item addMagazineCargoGlobal [_itemtodrop,1]; - }; - - if (_invehicle) then { + } else { sleep 2; (vehicle player) addMagazineCargoGlobal [_itemtodrop,1]; }; - }; //add infection chance for "ItemWaterbottle",