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

@@ -4,8 +4,8 @@ class RscDisplayGear
enableDisplay = 1; enableDisplay = 1;
movingEnable = 0; movingEnable = 0;
//onLoad = "[] spawn object_monitorGear; {player removeMagazines _x} count MeleeMagazines; call gear_ui_init; call ui_gear_sound; if (isNil('IGUI_GEAR_activeFilter')) then { IGUI_GEAR_activeFilter = 0;}; [_this,'onLoad'] execVM '\z\addons\dayz_code\system\handleGear.sqf'";/* diag_log 'RscDisplayGear : : onLoad'; */ //onLoad = "[] spawn object_monitorGear; false call dz_fn_meleeMagazines; call gear_ui_init; call ui_gear_sound; if (isNil('IGUI_GEAR_activeFilter')) then { IGUI_GEAR_activeFilter = 0;}; [_this,'onLoad'] execVM '\z\addons\dayz_code\system\handleGear.sqf'";/* diag_log 'RscDisplayGear : : onLoad'; */
//onUnload = "{player removeMagazines _x} count MeleeMagazines; call player_forceSave; call dayz_meleeMagazineCheck;"; /* diag_log 'RscDisplayGear : : onunLoad'; */ //onUnload = "false call dz_fn_meleeMagazines; call player_forceSave; call dayz_meleeMagazineCheck;"; /* diag_log 'RscDisplayGear : : onunLoad'; */
onLoad = "setMousePosition [0.5, 0.5];_this call fn_gearMenuChecks; false call dz_fn_meleeMagazines; [] spawn object_monitorGear; call gear_ui_init; call ui_gear_sound; if (isNil 'IGUI_GEAR_activeFilter') then {IGUI_GEAR_activeFilter = 0}; [_this, 'onLoad'] execVM '\z\addons\dayz_code\system\handleGear.sqf'"; onLoad = "setMousePosition [0.5, 0.5];_this call fn_gearMenuChecks; false call dz_fn_meleeMagazines; [] spawn object_monitorGear; call gear_ui_init; call ui_gear_sound; if (isNil 'IGUI_GEAR_activeFilter') then {IGUI_GEAR_activeFilter = 0}; [_this, 'onLoad'] execVM '\z\addons\dayz_code\system\handleGear.sqf'";
onUnload = "true call dz_fn_meleeMagazines; call player_selectWeapon; call player_forceSave;"; onUnload = "true call dz_fn_meleeMagazines; call player_selectWeapon; call player_forceSave;";
onMouseMoving = "[] call gear_ui_hide;"; onMouseMoving = "[] call gear_ui_hide;";
@@ -316,7 +316,7 @@ class RscDisplayGear
x = -2; x = -2;
style = 2048; style = 2048;
onSetFocus = "[_this,'onFocus'] execVM '\z\addons\dayz_code\system\handleGear.sqf'"; onSetFocus = "[_this,'onFocus'] execVM '\z\addons\dayz_code\system\handleGear.sqf'";
onButtonClick = "{player removeMagazines _x} count MeleeMagazines; [_this,'onLBListSelChanged'] execVM '\z\addons\dayz_code\system\handleGear.sqf'"; onButtonClick = "false call dz_fn_meleeMagazines; [_this,'onLBListSelChanged'] execVM '\z\addons\dayz_code\system\handleGear.sqf'";
text = "<"; text = "<";
}; };
@@ -351,7 +351,7 @@ class RscDisplayGear
idc = 147; idc = 147;
x = -2; x = -2;
onSetFocus = "[_this,""onFocus""] execVM '\z\addons\dayz_code\system\handleGear.sqf'"; onSetFocus = "[_this,""onFocus""] execVM '\z\addons\dayz_code\system\handleGear.sqf'";
onButtonClick = "{player removeMagazines _x} count MeleeMagazines; [_this,""onLBListSelChanged""] execVM '\z\addons\dayz_code\system\handleGear.sqf'"; onButtonClick = "false call dz_fn_meleeMagazines; [_this,""onLBListSelChanged""] execVM '\z\addons\dayz_code\system\handleGear.sqf'";
text = ">"; text = ">";
}; };
}; };

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -45,7 +45,7 @@ if (_hasToolbox) then {
if (_finished) then { if (_finished) then {
//Remove melee magazines (BIS_fnc_invAdd fix) //Remove melee magazines (BIS_fnc_invAdd fix)
{player removeMagazines _x} count MeleeMagazines; false call dz_fn_meleeMagazines;
_damage = [_vehicle,_hitpoint] call object_getHit; _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 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"]; _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; localize "str_player_24" call dayz_rollingMessages;
}; };
}; };
true call dz_fn_meleeMagazines;
} else { } else {
r_interrupt = false; r_interrupt = false;
if (vehicle player == player) then { if (vehicle player == player) then {

View File

@@ -21,7 +21,7 @@ _keySelected = format["ItemKey%1%2",_keyColor,_keyNumber];
_isKeyOK = isClass(configFile >> "CfgWeapons" >> _keySelected); _isKeyOK = isClass(configFile >> "CfgWeapons" >> _keySelected);
//Remove melee magazines (BIS_fnc_invAdd fix) //Remove melee magazines (BIS_fnc_invAdd fix)
{player removeMagazines _x} count MeleeMagazines; false call dz_fn_meleeMagazines;
_isOk = [player,_keySelected] call BIS_fnc_invAdd; _isOk = [player,_keySelected] call BIS_fnc_invAdd;
true call dz_fn_meleeMagazines;
[(_isOk && _isKeyOK),_keySelected] [(_isOk && _isKeyOK),_keySelected]

View File

@@ -35,10 +35,11 @@ if (_this in items player) then {
}; };
} else { } else {
//Remove melee magazines (BIS_fnc_invAdd fix) //Remove melee magazines (BIS_fnc_invAdd fix)
{player removeMagazines _x} count MeleeMagazines; false call dz_fn_meleeMagazines;
if !([player,_this] call BIS_fnc_invAdd) then { if !([player,_this] call BIS_fnc_invAdd) then {
systemChat localize "str_epoch_player_107"; systemChat localize "str_epoch_player_107";
_this call _dropOnFloor; _this call _dropOnFloor;
}; };
true call dz_fn_meleeMagazines;
}; };

View File

@@ -1061,7 +1061,6 @@ class FSM
"player disableConversation true;" \n "player disableConversation true;" \n
"" \n "" \n
"eh_player_killed = player addeventhandler [""FiredNear"",{_this call player_weaponFiredNear;} ];" \n "eh_player_killed = player addeventhandler [""FiredNear"",{_this call player_weaponFiredNear;} ];" \n
"//player addEventHandler ['Respawn', player_death];" \n
"" \n "" \n
"//_state = player getVariable[""state"",[]];" \n "//_state = player getVariable[""state"",[]];" \n
"_currentWpn = """";" \n "_currentWpn = """";" \n