After eating in a vehicle that should drop an empty can, client RPT would show:

Error Undefined variable in expression: _itemtodrop
This commit is contained in:
deadeye2
2014-08-20 19:41:06 -04:00
parent 740f4144f1
commit e4982dc313

View File

@@ -48,26 +48,26 @@ if (dayz_lastMeal < 3600) then {
};
};
if (_hasoutput && !_invehicle) then {
if (_hasoutput) then {
// Selecting output
_itemtodrop = food_output select (food_with_output find _itemorignal);
if (!_invehicle) then {
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 (_hasoutput && _invehicle) then {
} else {
sleep 2;
(vehicle player) addMagazineCargoGlobal [_itemtodrop,1];
};
};
if (_rawfood && !_rawexceptions && (random 15 < 1)) then {