Fix potential magazine and weapon dupes

This reverts 4b171cb.

player_regularSave should only be used if player_forceSave would interrupt an action like fire a weapon since it opens a dialog. player_regularSave does not save the ammo count but all magazines. Do not use nil instead of the magazines player array since it makes duping possible.

Thx to mmrsz
This commit is contained in:
AirwavesMan
2021-04-16 13:24:18 +02:00
parent 4b171cb636
commit e8f2f3fcf0
7 changed files with 14 additions and 15 deletions

View File

@@ -1,5 +1,5 @@
private ["_charID","_model","_old","_humanity","_medical","_worldspace","_zombieKills","_headShots","_humanKills","_combattimeout","_inCombat","_banditKills","_fractures","_survivalTime","_coins","_bankCoins","_globalCoins","_ConfirmedHumanKills","_ConfirmedBanditKills","_friendlies","_tagSetting"];
//_playerUID = _this select 0;
closeDialog 0;
_charID = _this select 1;
_model = _this select 2;
@@ -13,7 +13,6 @@ _old removeAllEventHandlers "Fired";
_old allowDamage false;
_old AddEventHandler ["HandleDamage", {False}];
dayz_unsaved = true;
//Logout
_humanity = player getVariable ["humanity",0];
_medical = player call player_sumMedical;
@@ -111,4 +110,4 @@ player allowDamage true;
uiSleep 0.1;
if !(isNull _old) then {deleteVehicle _old;};
call player_forceSave;
call player_forceSave;