Fix #1981 and Incidental dupe

thanks @AirwavesMan
This commit is contained in:
icomrade
2017-09-13 14:51:34 -04:00
parent d750f576ed
commit 7ae6aa56dd
2 changed files with 18 additions and 5 deletions

View File

@@ -56,6 +56,7 @@
[FIXED] Added temporary fix for missing AS50 ammo error with beta branch core patch. #1955 @AirwavesMan
[FIXED] Melee and tranquilizer bolt knockouts were usually instant or far shorter than the intended time of 20s-80s.
[FIXED] Multiple dupe fixes - SERVER ADMINS, DO NOT IMPLEMENT SCRIPTS WHICH KICK PLAYERS TO THE LOBBY (ENDMISSION, FAILMISSION, etc.), YOU MUST KICK THEM ENTIRELY OUT OF THE SERVER! (EX: by BE restriction, but with the stock scripts.txt forceEnd, failmission, and endmission should kick the player anyway)
[FIXED] Certain classes (i.e. Satchel Charge) which are both magazines and weapons were not retained through skin change #1981 @AirwavesMan
[NOTE] Fixes below are included in the mission file and server pbo as part of server package 1.0.6.1A (March 10th 2017)
[FIXED] Fixed food and drink going down 10x faster from melee and other "working" actions.

View File

@@ -1,4 +1,4 @@
private ["_weapons","_isArray","_backpackWpn","_backpackMag","_currentWpn","_isWeapon","_backpackWpnTypes","_backpackWpnQtys","_countr","_class","_position","_dir","_currentAnim","_playerUID","_countMags","_magazines","_primweapon","_secweapon","_newBackpackType","_muzzles","_oldUnit","_group","_newUnit","_oldGroup","_idc","_display","_switchUnit","_leader","_currentCamera"];
private ["_weapons","_isArray","_backpackWpn","_backpackMag","_currentWpn","_isWeapon","_isMagazine","_backpackWpnTypes","_backpackWpnQtys","_countr","_class","_position","_dir","_currentAnim","_playerUID","_countMags","_magazines","_primweapon","_secweapon","_newBackpackType","_muzzles","_oldUnit","_group","_newUnit","_oldGroup","_idc","_display","_switchUnit","_leader","_currentCamera"];
_isArray = typeName _this == "ARRAY";
if (_isArray) then {
_class = _this select 0;
@@ -162,15 +162,27 @@ if (!isNil "_newBackpackType" && {_newBackpackType != ""}) then {
{
if (typeName _x != "STRING") then {
_isWeapon = isClass (configFile >> "CfgWeapons" >> (_x select 0));
_isMagazine = isClass (configFile >> "CfgMagazines" >> (_x select 0));
if (_isWeapon && !_isMagazine) then {
_backpackWpnTypes set [count _backpackWpnTypes, (_x select 0)];
_backpackWpnQtys set [count _backpackWpnQtys, (_x select 1)];
};
} else {
_isWeapon = isClass (configFile >> "CfgWeapons" >> _x);
_isMagazine = isClass (configFile >> "CfgMagazines" >> _x);
if (_isWeapon && !_isMagazine) then {
_backpackWpnTypes set [count _backpackWpnTypes, _x];
_backpackWpnQtys set [count _backpackWpnQtys, 1];
};
};
if (!_isWeapon) then {
if (!_isWeapon || (_isWeapon && _isMagazine)) then {
_countr = _countr + 1;
if (typeName _x != "STRING") then {
dayz_myBackpack addMagazineCargoGlobal [_x select 0, 1];
_idc = 4999 + _countr;
_idc setIDCAmmoCount (_x select 1);
if (_x select 1 > 0) then { //Javelin rockets in BP returns ["Javelin", 0],"Javelin". Dupe on relog -> # real Javs + 1 per skin change
dayz_myBackpack addMagazineCargoGlobal [_x select 0, 1];
_idc = 4999 + _countr;
_idc setIDCAmmoCount (_x select 1);
};
} else {
dayz_myBackpack addMagazineCargoGlobal [_x, 1];
};