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

@@ -4,14 +4,16 @@
Email: N/A
Creation date: 2020-12-30 17:20:00
Last modified time: 2021-03-08 14:04:00
Last modified time: 2021-04-16 09:20:00
Description:
Requests a simple save for the player object.
Requests a simple save for the player object. Does not save the ammo count but it does not interrupt actions like shooting.
Example:
call player_regularSave;
Return:
Nothing
*/
PVDZ_plr_Save = [player,nil,dayz_onBack,weapons player];
local _magazineArray = (magazines player) - ["CSGAS","Hatchet_Swing","Crowbar_Swing","Machete_Swing","Bat_Swing","BatBarbed_Swing","BatNails_Swing","Fishing_Swing","Sledge_Swing"];
PVDZ_plr_Save = [player,_magazineArray,dayz_onBack,weapons player];
publicVariableServer "PVDZ_plr_Save";