Add back melee ammo after removal for BIS_fnc_inv

Vanilla commit:

516d1d538c
This commit is contained in:
ebaydayz
2016-10-13 20:26:07 -04:00
parent 7044b0095d
commit 916f1733eb
13 changed files with 28 additions and 20 deletions

View File

@@ -69,9 +69,9 @@ if (_classname isKindOf "Bag_Base_EP1") exitWith {
_config = (configFile >> _type >> _classname);
//Remove melee magazines (BIS_fnc_invAdd fix)
{player removeMagazines _x} count MeleeMagazines;
false call dz_fn_meleeMagazines;
_isOk = [player,_config] call BIS_fnc_invAdd;
true call dz_fn_meleeMagazines;
if (_isOk) then {
deleteVehicle _holder;

View File

@@ -52,7 +52,7 @@ _hasInput = true;
if (_hasInput) then {
//Remove melee magazines (BIS_fnc_invAdd and BIS_fnc_invSlotsEmpty fix)
{player removeMagazines _x} count MeleeMagazines;
false call dz_fn_meleeMagazines;
_freeSlots = [player] call BIS_fnc_invSlotsEmpty;
{
_item = _x select 0;
@@ -66,7 +66,7 @@ if (_hasInput) then {
};
};
} forEach _input;
true call dz_fn_meleeMagazines;
_availabeSpace = true;
//uiSleep 1;

View File

@@ -50,7 +50,7 @@ if ((count _upgrade) > 0) then {
_i = 0;
_addedItems = [];
//Remove melee magazines (BIS_fnc_invAdd fix)
{player removeMagazines _x} count MeleeMagazines;
false call dz_fn_meleeMagazines;
{
_itemOut = _x select 0;
@@ -70,6 +70,7 @@ if ((count _upgrade) > 0) then {
if (_abortInvAdd) exitWith {};
} count _refund;
true call dz_fn_meleeMagazines;
// all parts added proceed
if(_i != 0) then {

View File

@@ -89,7 +89,7 @@ if(!r_drag_sqf and !r_player_unconscious and !_onLadder) then {
if (_hasInput) then {
//Remove melee magazines (BIS_fnc_invAdd and BIS_fnc_invSlotsEmpty fix)
{player removeMagazines _x} count MeleeMagazines;
false call dz_fn_meleeMagazines;
_freeSlots = [player] call BIS_fnc_invSlotsEmpty;
{
_item = _x select 0;
@@ -122,6 +122,7 @@ if(!r_drag_sqf and !r_player_unconscious and !_onLadder) then {
};
} forEach _output;
//uiSleep 1;
true call dz_fn_meleeMagazines;
if (_availabeSpace) then {
//player playActionNow "PutDown";

View File

@@ -77,7 +77,7 @@ if (count _nearByPile > 0) then {
if (_hasInput) then {
//Remove melee magazines (BIS_fnc_invAdd and BIS_fnc_invSlotsEmpty fix)
{player removeMagazines _x} count MeleeMagazines;
false call dz_fn_meleeMagazines;
_freeSlots = [player] call BIS_fnc_invSlotsEmpty;
{
_item = _x select 0;
@@ -109,6 +109,7 @@ if (count _nearByPile > 0) then {
};
};
} forEach _output;
true call dz_fn_meleeMagazines;
//uiSleep 1;
if (_availabeSpace) then {

View File

@@ -94,7 +94,7 @@ if (count(_findNearestTree) >= 1) then {
if (_proceed) then {
//Remove melee magazines (BIS_fnc_invAdd fix)
{player removeMagazines _x} count MeleeMagazines;
false call dz_fn_meleeMagazines;
_invResult = false;
_i = 0;
for "_x" from 1 to _countOut do {
@@ -103,6 +103,7 @@ if (count(_findNearestTree) >= 1) then {
_i = _i + 1;
};
};
true call dz_fn_meleeMagazines;
_text = getText (configFile >> "CfgMagazines" >> _itemOut >> "displayName");

View File

@@ -27,12 +27,14 @@ _newWeapon = _this select 2;
//check that player has enough room in inventory
//Remove melee magazines (BIS_fnc_invAdd and BIS_fnc_invSlotsEmpty fix)
{player removeMagazines _x} count MeleeMagazines;
false call dz_fn_meleeMagazines;
if ((([player] call BIS_fnc_invSlotsEmpty) select 4) < 1) exitWith
{
closeDialog 0;
(localize "str_player_24") call dayz_rollingMessages;
true call dz_fn_meleeMagazines;
};
true call dz_fn_meleeMagazines;
//check that player has the weapon
if (!(player hasWeapon _weapon)) exitWith

View File

@@ -33,7 +33,7 @@ switch (_rounded) do {
};
//Remove melee magazines (BIS_fnc_invAdd fix)
{player removeMagazines _x} count MeleeMagazines;
false call dz_fn_meleeMagazines;
_i = 0;
while {_i < _rounded} do {
_i = _i + 1;
@@ -58,4 +58,5 @@ while {_i < _rounded} do {
};
_pile addMagazineCargoGlobal [_itemtocreate,1];
};
};
};
true call dz_fn_meleeMagazines;

View File

@@ -45,7 +45,7 @@ if (_hasToolbox) then {
if (_finished) then {
//Remove melee magazines (BIS_fnc_invAdd fix)
{player removeMagazines _x} count MeleeMagazines;
false call dz_fn_meleeMagazines;
_damage = [_vehicle,_hitpoint] call object_getHit;
if (_damage < 1 && {_damage > 0}) then { //Tempfix for issue where certain hitpoints on some vehicles do not get damaged and allow infinite removal
_BreakableParts = ["HitGlass1","HitGlass2","HitGlass3","HitGlass4","HitGlass5","HitGlass6","HitLGlass","HitRGlass","HitEngine","HitFuel","HitHRotor"];
@@ -80,6 +80,7 @@ if (_hasToolbox) then {
localize "str_player_24" call dayz_rollingMessages;
};
};
true call dz_fn_meleeMagazines;
} else {
r_interrupt = false;
if (vehicle player == player) then {