Prevent MeleeMagazines being counted by BIS_fnc_inv

This commit is contained in:
ebaydayz
2016-05-03 12:21:43 -04:00
parent f8b3ba2105
commit 2f98fc0451
18 changed files with 42 additions and 18 deletions

View File

@@ -1,7 +1,8 @@
private ["_selection","_return","_toBuyWeaps","_toBuyMags","_toBuyBags","_toolsToBuy","_sidearmToBuy","_primaryToBuy","_currentPrimarys"
,"_currentSecondarys","_currentSec","_currentPrim","_currentTool","_p","_s","_b","_check0","_check1","_check2","_check3","_check4","_mags","_weaps","_bags"
,"_normalBags","_normalMags","_normalWeaps","_allowedMags","_allowedPrimary","_allowedTools","_allowedSidearm","_allowedWeapons","_allowedBackpacks"
,"_totalSpace","_totalNewSpace","_counter","_parentClasses","_alreadyInBackpack","_kinds","_kinds2","_kinds3","_ammmounts","_ammmounts2","_ammmounts3"
,"_totalSpace","_totalNewSpace","_counter","_parentClasses","_alreadyInBackpack","_kinds","_kinds2","_kinds3","_ammmounts","_ammmounts2","_ammmounts3",
"_actualMags"
];
_selection = Z_SellingFrom;
_return = false;
@@ -19,7 +20,8 @@ if (_vehiclesToBuy > 0) then {
};
if(_selection == 2) then{ //gear
_allowedMags = 20 - count(magazines player);
_actualMags = {!(_x in MeleeMagazines)} count (magazines player);
_allowedMags = 20 - _actualMags;
_currentPrimarys = 0;

View File

@@ -1,11 +1,12 @@
private["_selection","_returnArray","_allowedMags","_allowedWeapons","_allowedBackpacks","_allowedTools","_allowedPrimary","_allowedSidearm","_formattedText","_pic"
,"_backpack","_backpackAmount","_vehicleWeapons","_vehicleMagazines","_vehicleBackpacks","_tempWeaponsArray","_tempBackpackArray","_tempMagazinesArray"];
,"_backpack","_backpackAmount","_vehicleWeapons","_vehicleMagazines","_vehicleBackpacks","_tempWeaponsArray","_tempBackpackArray","_tempMagazinesArray","_actualMags"];
#include "defines.sqf";
_selection = _this select 0;
_returnArray = [0,0,0];
if(_selection == 2) then{ //gear
_allowedMags = 20 - count(magazines player);
_actualMags = {!(_x in MeleeMagazines)} count (magazines player);
_allowedMags = 20 - _actualMags;
_allowedWeapons = 14 - count(weapons player);
_pic = getText (configFile >> 'CfgVehicles' >> (typeOf player) >> 'picture');

View File

@@ -21,7 +21,7 @@ if (!isNil '_pic' && _pic == "") then {
};
_formattedText = format [
"<t size='1' align='center' color='#ffffff'> %2 </t>"
"<t size='1' align='center' color='#ffffff'>%1 %2</t>"
, _pic, localize "STR_UI_GEAR"
];

View File

@@ -51,6 +51,8 @@ _hasInput = true;
} forEach (_input + _required);
if (_hasInput) then {
//Remove melee magazines (BIS_fnc_invAdd and BIS_fnc_invSlotsEmpty fix)
{player removeMagazines _x} count MeleeMagazines;
_freeSlots = [player] call BIS_fnc_invSlotsEmpty;
{
_item = _x select 0;

View File

@@ -84,6 +84,8 @@ if ((count _upgrade) > 0) then {
_abortInvAdd = false;
_i = 0;
_addedItems = [];
//Remove melee magazines (BIS_fnc_invAdd fix)
{player removeMagazines _x} count MeleeMagazines;
{
_itemOut = _x select 0;

View File

@@ -87,6 +87,8 @@ if(!r_drag_sqf and !r_player_unconscious and !_onLadder) then {
} forEach (_input);
if (_hasInput) then {
//Remove melee magazines (BIS_fnc_invAdd and BIS_fnc_invSlotsEmpty fix)
{player removeMagazines _x} count MeleeMagazines;
_freeSlots = [player] call BIS_fnc_invSlotsEmpty;
{
_item = _x select 0;

View File

@@ -76,6 +76,8 @@ if (count _nearByPile > 0) then {
} forEach (_input + _required);
if (_hasInput) then {
//Remove melee magazines (BIS_fnc_invAdd and BIS_fnc_invSlotsEmpty fix)
{player removeMagazines _x} count MeleeMagazines;
_freeSlots = [player] call BIS_fnc_invSlotsEmpty;
{
_item = _x select 0;

View File

@@ -93,7 +93,8 @@ if (count(_findNearestTree) >= 1) then {
};
if (_proceed) then {
//Remove melee magazines (BIS_fnc_invAdd fix)
{player removeMagazines _x} count MeleeMagazines;
_invResult = false;
_i = 0;
for "_x" from 1 to _countOut do {

View File

@@ -26,6 +26,8 @@ _weapon = _this select 1;
_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;
if ((([player] call BIS_fnc_invSlotsEmpty) select 4) < 1) exitWith
{
closeDialog 0;

View File

@@ -31,6 +31,8 @@ switch (_rounded) do {
};
};
//Remove melee magazines (BIS_fnc_invAdd fix)
{player removeMagazines _x} count MeleeMagazines;
_i = 0;
while {_i < _rounded} do {
_i = _i + 1;

View File

@@ -63,9 +63,7 @@ switch _option do {
[player,_range,true,(getPosATL player)] spawn player_alertZombies;
player setVariable["cashMoney",_newWealth,true];
PVDZ_plr_Save = [player,(magazines player),true,true];
publicVariableServer "PVDZ_plr_Save";
call player_forceSave;
PVDZE_maintainArea = [player,1,_target];
publicVariableServer "PVDZE_maintainArea";

View File

@@ -44,6 +44,8 @@ if (_hasToolbox) then {
r_doLoop = false;
if (_finished) then {
//Remove melee magazines (BIS_fnc_invAdd fix)
{player removeMagazines _x} count MeleeMagazines;
_damage = [_vehicle,_hitpoint] call object_getHit;
if (_damage < 0.10) then {
_BreakableParts = ["HitGlass1","HitGlass2","HitGlass3","HitGlass4","HitGlass5","HitGlass6","HitLGlass","HitRGlass","HitEngine","HitFuel","HitHRotor"];
@@ -56,9 +58,6 @@ if (_hasToolbox) then {
_brokenPart = false;
};
} else {
//Remove melee ammo due to the way ammo is working.
{player removeMagazines _x} count MeleeMagazines;
_isOK = [player,_part] call BIS_fnc_invAdd;
_brokenPart = false;
};

View File

@@ -129,6 +129,8 @@ if (_finished) then {
_isKeyOK = isClass(configFile >> "CfgWeapons" >> _keySelected);
//Remove melee magazines (BIS_fnc_invAdd fix)
{player removeMagazines _x} count MeleeMagazines;
_config = _keySelected;
_isOk = [player,_config] call BIS_fnc_invAdd;

View File

@@ -109,6 +109,8 @@ if (_qty >= _qty_in) then {
_isKeyOK = isClass(configFile >> "CfgWeapons" >> _keySelected);
//Remove melee magazines (BIS_fnc_invAdd fix)
{player removeMagazines _x} count MeleeMagazines;
_config = _keySelected;
_isOk = [player,_config] call BIS_fnc_invAdd;
waitUntil {!isNil "_isOk"};

View File

@@ -128,6 +128,8 @@ if (_finished) then {
_isKeyOK = isClass(configFile >> "CfgWeapons" >> _keySelected);
//Remove melee magazines (BIS_fnc_invAdd fix)
{player removeMagazines _x} count MeleeMagazines;
_config = _keySelected;
_isOk = [player,_config] call BIS_fnc_invAdd;

View File

@@ -116,6 +116,8 @@ if (_qty >= _qty_in) then {
_isKeyOK = isClass(configFile >> "CfgWeapons" >> _keySelected);
//Remove melee magazines (BIS_fnc_invAdd fix)
{player removeMagazines _x} count MeleeMagazines;
_config = _keySelected;
_isOk = [player,_config] call BIS_fnc_invAdd;
waitUntil {!isNil "_isOk"};

View File

@@ -1,4 +1,4 @@
private ["_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_textPartIn","_textPartOut","_bos","_needed","_started","_finished","_animState","_isMedic","_total_parts_out","_abort","_removed","_activatingPlayer","_traderID","_done"];
private ["_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_textPartIn","_textPartOut","_bos","_needed","_started","_finished","_animState","_isMedic","_total_parts_out","_abort","_removed","_activatingPlayer","_traderID","_done","_actualMags"];
// [part_out,part_in, qty_out, qty_in,];
if (DZE_ActionInProgress) exitWith {localize "str_epoch_player_103" call dayz_rollingMessages;};
@@ -29,8 +29,8 @@ while {r_autoTrade} do {
_removed = 0;
// check if current magazine count is greater than 20
if ((count (magazines player)) > 20) exitWith {localize "str_player_24" call dayz_rollingMessages; r_autoTrade = false};
_actualMags = {!(_x in MeleeMagazines)} count (magazines player);
if (_actualMags > 20) exitWith {localize "str_player_24" call dayz_rollingMessages; r_autoTrade = false};
_canAfford = false;
if(_bos == 1) then {

View File

@@ -34,6 +34,9 @@ if (_this in items player) then {
_this call _dropOnFloor;
};
} else {
//Remove melee magazines (BIS_fnc_invAdd fix)
{player removeMagazines _x} count MeleeMagazines;
if !([player,_this] call BIS_fnc_invAdd) then {
systemChat localize "str_epoch_player_107";
_this call _dropOnFloor;