Skip to content

Commit

Permalink
server_updateObject better version.
Browse files Browse the repository at this point in the history
  • Loading branch information
oiad committed Mar 16, 2017
1 parent 94fd896 commit 67928dd
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions dayz_server/compile/server_updateObject.sqf
Expand Up @@ -242,27 +242,6 @@ _object_variables = {
_key call server_hiveWrite;
};

_object_coins = {
private ["_inventory","_key","_coins"];
_inventory = [getWeaponCargo _object, getMagazineCargo _object, getBackpackCargo _object];
_object setVariable["lastInventory",_inventory];
if (_objectID == "0") then {
_key = format["CHILD:309:%1:",_objectUID] + str _inventory + ":";
} else {
_key = format["CHILD:303:%1:",_objectID] + str _inventory + ":";
};
if (Z_SingleCurrency) then {
_coins = _object getVariable [Z_MoneyVariable, -1]; //set to invalid value if getVariable fails to prevent overwriting of coins in DB
_key = _key + str _coins + ":";
};

#ifdef OBJECT_DEBUG
diag_log format["DELETE: Deleted by KEY: %1",_key];
#endif

_key call server_hiveWrite;
};

_object setVariable ["lastUpdate",diag_ticktime,true];
switch (_type) do {
case "all": {
Expand Down Expand Up @@ -292,6 +271,7 @@ switch (_type) do {
call _objWallDamage;
};
case "coins": {
call _object_coins;
_object setVariable ["lastInventory",["forceUpdate"]];
call _object_inventory;
};
};

0 comments on commit 67928dd

Please sign in to comment.