After buying a weapon the weapon should be selected correctly now

Thx iben for the fix.
This commit is contained in:
A Man
2022-05-25 09:22:19 +02:00
parent a51a5afc6b
commit 946c9c5c91
2 changed files with 6 additions and 6 deletions

View File

@@ -224,6 +224,7 @@ if (_enoughMoney) then {
dayz_onBack = _x select 0; //Add to back
} else {
player addWeapon (_x select 0);
call player_selectWeapon;
};
_count = _count + 1;
};
@@ -241,7 +242,7 @@ if (_enoughMoney) then {
if ((_x select 1) in DZE_tradeVehicle) then {
_item2Add = [(_x select 0), (_x select 1)] call _buyVehicle;
if (_item2Add != "0") then {
player addWeapon _item2Add;
player addWeapon _item2Add;
};
};
_bTotal = _bTotal + (_x select 9);

View File

@@ -3,17 +3,16 @@
when the player's currently selected weapon is a throwable.
*/
private ["_main","_muzzle"];
if (currentWeapon player == "Throw") then {
_main = primaryWeapon player;
if (currentWeapon player in ["Throw", ""]) then {
local _main = primaryWeapon player;
if (_main == "") then {
{
if (getNumber (configFile >> "CfgWeapons" >> _x >> "type") == 2) then {_main = _x;};
} count (weapons player);
};
_muzzle = getArray (configFile >> "CfgWeapons" >> _main >> "muzzles");
if (_main == "") exitWith {};
local _muzzle = getArray (configFile >> "CfgWeapons" >> _main >> "muzzles");
if (count _muzzle > 1) then {
player selectWeapon (_muzzle select 0);
} else {