mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-21 19:06:29 +03:00
Fix tool loss due to duplicate matchbox and knife issue #1849
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
private ["_skin","_rnd","_rounded","_itemtocreate","_i","_config","_infoText","_result","_nearByPile","_pile","__FILE__"];
|
||||
private ["_skin","_rnd","_rounded","_itemtocreate","_i","_config","_result"];
|
||||
|
||||
_skin = _this;
|
||||
_config = configFile >> "CfgMagazines" >> _skin;
|
||||
@@ -8,7 +8,6 @@ _rnd = random 3;
|
||||
_rounded = round _rnd;
|
||||
call gear_ui_init;
|
||||
closeDialog 0;
|
||||
_infoText = "";
|
||||
|
||||
//Tear the clothes
|
||||
player playActionNow "Medic";
|
||||
@@ -46,17 +45,7 @@ while {_i < _rounded} do {
|
||||
|
||||
if (!_result) then {
|
||||
systemchat (localize ("str_tear_clothes_noroom"));
|
||||
|
||||
_nearByPile = nearestObjects [getPosATL player, ["WeaponHolder","WeaponHolderBase"], 2];
|
||||
_pile = if (count _nearByPile > 0) then {_nearByPile select 0};
|
||||
if (count _nearByPile == 0) then {
|
||||
_pos = player modeltoWorld [0,1,0];
|
||||
_pos set [2, 0];
|
||||
//diag_log format [ "%1 itempos:%2 _nearByPile:%3", __FILE__, _pos, _nearByPile];
|
||||
_pile = createVehicle ["WeaponHolder", _pos, [], 0.0, "CAN_COLLIDE"];
|
||||
_pile setPosATL _pos;
|
||||
};
|
||||
_pile addMagazineCargoGlobal [_itemtocreate,1];
|
||||
[_itemtocreate,1,1] call fn_dropItem;
|
||||
};
|
||||
};
|
||||
true call dz_fn_meleeMagazines;
|
||||
Reference in New Issue
Block a user