Files
DayZ-Epoch/SQF/dayz_code/compile/player_forceSave.sqf
AirwavesMan e8f2f3fcf0 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
2021-04-16 13:24:18 +02:00

17 lines
609 B
Plaintext

/*
Opens player inventory to save
Do not use this in constant running loops or actions. force_Save opens the inventory with a dialog call.
That will interrupt actions like shooting. For loops use player_regularSave but keep in mind player_regularSave does not save the ammo count.
*/
local _magazineArray = [] call player_countMagazines;
PVDZ_plr_Save = [player, if (player isKindOf "PZombie_VB") then {nil} else {_magazineArray},dayz_onBack,weapons player];
publicVariableServer "PVDZ_plr_Save";
//diag_log format["Player_forceSave with magazines: %1",_magazineArray];
dayz_lastSave = diag_tickTime;