mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-13 11:42:38 +03:00
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:
@@ -53,7 +53,7 @@ if (_classname isKindOf "Bag_Base_EP1") exitWith {
|
|||||||
waitUntil { !isNull (unitBackpack player) };
|
waitUntil { !isNull (unitBackpack player) };
|
||||||
uiSleep 0.03;
|
uiSleep 0.03;
|
||||||
|
|
||||||
call player_regularSave;
|
call player_forceSave;
|
||||||
};
|
};
|
||||||
|
|
||||||
_config = (configFile >> _type >> _classname);
|
_config = (configFile >> _type >> _classname);
|
||||||
|
|||||||
@@ -115,5 +115,5 @@ player setVariable ["sleeping",false];
|
|||||||
dayz_actionInProgress = false;
|
dayz_actionInProgress = false;
|
||||||
|
|
||||||
//Removed due to player sync returning []
|
//Removed due to player sync returning []
|
||||||
//call player_regularSave;
|
//call player_forceSave;
|
||||||
R3F_TIRED_Accumulator = 0;
|
R3F_TIRED_Accumulator = 0;
|
||||||
@@ -63,7 +63,7 @@ if !(alive _item) then {
|
|||||||
dayz_lastMeal = time;
|
dayz_lastMeal = time;
|
||||||
dayz_hunger = 0;
|
dayz_hunger = 0;
|
||||||
|
|
||||||
call player_regularSave;
|
call player_forceSave;
|
||||||
|
|
||||||
[player,"eat",0,false] call dayz_zombieSpeak;
|
[player,"eat",0,false] call dayz_zombieSpeak;
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ if (isNil "keyboard_keys") then {
|
|||||||
};
|
};
|
||||||
local _dze_q = {
|
local _dze_q = {
|
||||||
if (!_ctrlState && !_altState) then {DZE_Q = true;};
|
if (!_ctrlState && !_altState) then {DZE_Q = true;};
|
||||||
if (!_ctrlState && {_altState}) then {DZE_Q_alt = true;};
|
if (!_ctrlState && _altState) then {DZE_Q_alt = true;};
|
||||||
if (_ctrlState && !_altState) then {DZE_Q_ctrl = true;};
|
if (_ctrlState && !_altState) then {DZE_Q_ctrl = true;};
|
||||||
};
|
};
|
||||||
local _dze_z = {
|
local _dze_z = {
|
||||||
|
|||||||
@@ -1,16 +1,14 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
Opens player inventory to save
|
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;
|
local _magazineArray = [] call player_countMagazines;
|
||||||
|
|
||||||
if ((count _magazineArray) > 0) then {
|
PVDZ_plr_Save = [player, if (player isKindOf "PZombie_VB") then {nil} else {_magazineArray},dayz_onBack,weapons player];
|
||||||
PVDZ_plr_Save = [player, if (player isKindOf "PZombie_VB") then {nil} else {_magazineArray},dayz_onBack,weapons player];
|
|
||||||
} else {
|
|
||||||
PVDZ_plr_Save = [player,nil,dayz_onBack,weapons player];
|
|
||||||
};
|
|
||||||
publicVariableServer "PVDZ_plr_Save";
|
publicVariableServer "PVDZ_plr_Save";
|
||||||
|
|
||||||
//diag_log format["Player_forceSave with magazines: %1",_magazineArray];
|
//diag_log format["Player_forceSave with magazines: %1",_magazineArray];
|
||||||
|
|||||||
@@ -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"];
|
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;
|
_charID = _this select 1;
|
||||||
_model = _this select 2;
|
_model = _this select 2;
|
||||||
|
|
||||||
@@ -13,7 +13,6 @@ _old removeAllEventHandlers "Fired";
|
|||||||
_old allowDamage false;
|
_old allowDamage false;
|
||||||
_old AddEventHandler ["HandleDamage", {False}];
|
_old AddEventHandler ["HandleDamage", {False}];
|
||||||
|
|
||||||
dayz_unsaved = true;
|
|
||||||
//Logout
|
//Logout
|
||||||
_humanity = player getVariable ["humanity",0];
|
_humanity = player getVariable ["humanity",0];
|
||||||
_medical = player call player_sumMedical;
|
_medical = player call player_sumMedical;
|
||||||
@@ -111,4 +110,4 @@ player allowDamage true;
|
|||||||
|
|
||||||
uiSleep 0.1;
|
uiSleep 0.1;
|
||||||
if !(isNull _old) then {deleteVehicle _old;};
|
if !(isNull _old) then {deleteVehicle _old;};
|
||||||
call player_forceSave;
|
call player_forceSave;
|
||||||
@@ -4,14 +4,16 @@
|
|||||||
|
|
||||||
Email: N/A
|
Email: N/A
|
||||||
Creation date: 2020-12-30 17:20:00
|
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:
|
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:
|
Example:
|
||||||
call player_regularSave;
|
call player_regularSave;
|
||||||
Return:
|
Return:
|
||||||
Nothing
|
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";
|
publicVariableServer "PVDZ_plr_Save";
|
||||||
Reference in New Issue
Block a user