diff --git a/SQF/dayz_code/actions/AdvancedTrading/functions/DZE_deleteTradedVehicle.sqf b/SQF/dayz_code/actions/AdvancedTrading/functions/DZE_deleteTradedVehicle.sqf index 589a02705..0ab2a8eb1 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/functions/DZE_deleteTradedVehicle.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/functions/DZE_deleteTradedVehicle.sqf @@ -60,7 +60,7 @@ if ((count _VehKey2) > 0) then { } else { PVDZ_obj_Destroy = [(_VehKey2 select 2),(_VehKey2 select 3),player,(_VehKey2 select 1),DZE_AuthKey]; publicVariableServer "PVDZ_obj_Destroy"; - deleteVehicle (_VehKey2 select 1); + //deleteVehicle (_VehKey2 select 1); }; } else { _localResult2 = 0; diff --git a/SQF/dayz_code/actions/object_disassembly.sqf b/SQF/dayz_code/actions/object_disassembly.sqf index eb1eb2f66..3fc301536 100644 --- a/SQF/dayz_code/actions/object_disassembly.sqf +++ b/SQF/dayz_code/actions/object_disassembly.sqf @@ -72,9 +72,10 @@ for "_i" from 1 to 20 do { PVDZ_obj_Destroy = [_objectID,_objectUID,player,_cursorTarget,DZE_AuthKey]; publicVariableServer "PVDZ_obj_Destroy"; diag_log [diag_ticktime, __FILE__, "Networked object, request to destroy", PVDZ_obj_Destroy]; - }; - // remove object - deleteVehicle _cursorTarget; + } else { + // remove object + deleteVehicle _cursorTarget; + }; _cursorTarget = objNull; ["Working",0,[20,40,15,0]] call dayz_NutritionSystem; diff --git a/SQF/dayz_code/actions/object_dismantle.sqf b/SQF/dayz_code/actions/object_dismantle.sqf index 4671c694d..f35e4a9b2 100644 --- a/SQF/dayz_code/actions/object_dismantle.sqf +++ b/SQF/dayz_code/actions/object_dismantle.sqf @@ -135,7 +135,7 @@ if (_proceed) then { }; //Need to update for sanity no client should ever create or delete anything - deleteVehicle _object; + //deleteVehicle _object; [_dismantleToo,1,1] call fn_dropItem; }; diff --git a/SQF/dayz_code/actions/object_pickup.sqf b/SQF/dayz_code/actions/object_pickup.sqf index a389061eb..bf93d00fe 100644 --- a/SQF/dayz_code/actions/object_pickup.sqf +++ b/SQF/dayz_code/actions/object_pickup.sqf @@ -81,8 +81,9 @@ if (_isOk) then { }; PVDZ_obj_Destroy = [(_holder getVariable["ObjectID","0"]),(_holder getVariable["ObjectUID","0"]),player,_holder,DZE_AuthKey]; publicVariableServer "PVDZ_obj_Destroy"; + } else { + deleteVehicle _holder; }; - deleteVehicle _holder; } else { if (!_isOk) exitWith { _holder setVariable["claimed",0,true]; diff --git a/SQF/dayz_code/actions/object_upgradeStorage.sqf b/SQF/dayz_code/actions/object_upgradeStorage.sqf index d2baab9d9..e6f60ee33 100644 --- a/SQF/dayz_code/actions/object_upgradeStorage.sqf +++ b/SQF/dayz_code/actions/object_upgradeStorage.sqf @@ -130,7 +130,7 @@ if ((_startUpgrade) AND (isClass(_upgradeConfig))) then { //remove old tent PVDZ_obj_Destroy = [_objectID,_objectUID,player,_cursorTarget,DZE_AuthKey]; publicVariableServer "PVDZ_obj_Destroy"; - deleteVehicle _cursorTarget; + //deleteVehicle _cursorTarget; // remove parts from players inventory before creation of new tent. { diff --git a/SQF/dayz_code/actions/object_upgradebuilding.sqf b/SQF/dayz_code/actions/object_upgradebuilding.sqf index 9ac273db0..d9249b8d0 100644 --- a/SQF/dayz_code/actions/object_upgradebuilding.sqf +++ b/SQF/dayz_code/actions/object_upgradebuilding.sqf @@ -72,6 +72,9 @@ if (!_ok) exitWith { format [localize "str_upgradeMissingPart", _missing] call dayz_rollingMessages; }; +_PlayerNear = {isPlayer _x} count (([_cursorTarget] call FNC_GetPos) nearEntities ["CAManBase", 10]) > 1; +if (_PlayerNear) exitWith {localize "str_pickup_limit_5" call dayz_rollingMessages;}; + if (dayz_actionInProgress) exitWith { { player addMagazine _x; } forEach _upgradeParts; localize "str_player_actionslimit" call dayz_rollingMessages; @@ -123,8 +126,8 @@ _object setVariable ["padlockCombination",_ownerPasscode,true]; _object setVariable ["characterID",_characterID,true]; //remove old object -deleteVehicle _cursorTarget; -PVDZ_obj_Destroy = [_objectID,_objectUID,player,_object,DZE_AuthKey]; +//deleteVehicle _cursorTarget; +PVDZ_obj_Destroy = [_objectID,_objectUID,player,_cursorTarget,DZE_AuthKey]; publicVariableServer "PVDZ_obj_Destroy"; // create a weaponholder with dismissed parts diff --git a/SQF/dayz_code/actions/player_destroyTent.sqf b/SQF/dayz_code/actions/player_destroyTent.sqf index 6781ccec7..f0cd3da59 100644 --- a/SQF/dayz_code/actions/player_destroyTent.sqf +++ b/SQF/dayz_code/actions/player_destroyTent.sqf @@ -65,7 +65,7 @@ player addMagazine _emptycan; // Added Nutrition-Factor for work ["Working",0,[20,40,15,0]] call dayz_NutritionSystem; -PVDZ_obj_Destroy = [_objectID,_objectUID,player,_obj,DZE_AuthKey]; +PVDZ_obj_Destroy = [_objectID,_objectUID,player,_obj,DZE_AuthKey,false]; publicVariableServer "PVDZ_obj_Destroy"; //Send killed for object diff --git a/SQF/dayz_code/actions/remove.sqf b/SQF/dayz_code/actions/remove.sqf index 459ea97e3..3502d5c78 100644 --- a/SQF/dayz_code/actions/remove.sqf +++ b/SQF/dayz_code/actions/remove.sqf @@ -149,15 +149,15 @@ if (_proceed && _success) then { // Double check that object is not null if(!isNull(_obj)) then { - _ipos = getPosATL _obj; - deleteVehicle _obj; if(!_isWreck && !_isWreckBuilding) then { PVDZ_obj_Destroy = [_objectID,_objectUID,player,_obj,DZE_AuthKey]; publicVariableServer "PVDZ_obj_Destroy"; }; + //deleteVehicle _obj; + if (_isWreckBuilding) then { PVDZ_send = [player,"RemoveObject",_ipos]; publicVariableServer "PVDZ_send"; diff --git a/SQF/dayz_code/actions/trade_any_bicycle.sqf b/SQF/dayz_code/actions/trade_any_bicycle.sqf index ec30af9f5..667bfc075 100644 --- a/SQF/dayz_code/actions/trade_any_bicycle.sqf +++ b/SQF/dayz_code/actions/trade_any_bicycle.sqf @@ -186,7 +186,7 @@ if (_finished) then { PVDZ_obj_Destroy = [_objectID,_objectUID,_activatingPlayer,_obj,DZE_AuthKey]; publicVariableServer "PVDZ_obj_Destroy"; - deleteVehicle _obj; + //deleteVehicle _obj; // payout _canAfford = [[[_part_out,_qty_out]],1] call epoch_returnChange; diff --git a/SQF/dayz_code/actions/trade_any_bicycle_old.sqf b/SQF/dayz_code/actions/trade_any_bicycle_old.sqf index 66eabe992..f835550bc 100644 --- a/SQF/dayz_code/actions/trade_any_bicycle_old.sqf +++ b/SQF/dayz_code/actions/trade_any_bicycle_old.sqf @@ -159,7 +159,7 @@ if (_qty >= _qty_in) then { PVDZ_obj_Destroy = [_objectID,_objectUID,_activatingPlayer,_obj,DZE_AuthKey]; publicVariableServer "PVDZ_obj_Destroy"; - deleteVehicle _obj; + //deleteVehicle _obj; format[localize "str_epoch_player_181",_qty_in,_textPartIn,_qty_out,_textPartOut] call dayz_rollingMessages; }; diff --git a/SQF/dayz_code/actions/trade_any_boat.sqf b/SQF/dayz_code/actions/trade_any_boat.sqf index b48f35341..d865f5713 100644 --- a/SQF/dayz_code/actions/trade_any_boat.sqf +++ b/SQF/dayz_code/actions/trade_any_boat.sqf @@ -162,7 +162,7 @@ if (_finished) then { PVDZ_obj_Destroy = [_objectID,_objectUID,_activatingPlayer,_obj,DZE_AuthKey]; publicVariableServer "PVDZ_obj_Destroy"; - deleteVehicle _obj; + //deleteVehicle _obj; // payout _canAfford = [[[_part_out,_qty_out]],1] call epoch_returnChange; diff --git a/SQF/dayz_code/actions/trade_any_boat_old.sqf b/SQF/dayz_code/actions/trade_any_boat_old.sqf index a928edb8e..a00c351a0 100644 --- a/SQF/dayz_code/actions/trade_any_boat_old.sqf +++ b/SQF/dayz_code/actions/trade_any_boat_old.sqf @@ -145,7 +145,7 @@ if (_qty >= _qty_in) then { PVDZ_obj_Destroy = [_objectID,_objectUID,_activatingPlayer,_obj,DZE_AuthKey]; publicVariableServer "PVDZ_obj_Destroy"; - deleteVehicle _obj; + //deleteVehicle _obj; format[localize "str_epoch_player_181",_qty_in,_textPartIn,_qty_out,_textPartOut] call dayz_rollingMessages; } else { diff --git a/SQF/dayz_code/actions/trade_any_vehicle.sqf b/SQF/dayz_code/actions/trade_any_vehicle.sqf index 05ecc8203..21da65915 100644 --- a/SQF/dayz_code/actions/trade_any_vehicle.sqf +++ b/SQF/dayz_code/actions/trade_any_vehicle.sqf @@ -192,7 +192,7 @@ if (_finished) then { PVDZ_obj_Destroy = [_objectID,_objectUID,_activatingPlayer,_obj,DZE_AuthKey]; publicVariableServer "PVDZ_obj_Destroy"; - deleteVehicle _obj; + //deleteVehicle _obj; // remove Key _temp_keys = []; diff --git a/SQF/dayz_code/actions/trade_any_vehicle_free.sqf b/SQF/dayz_code/actions/trade_any_vehicle_free.sqf index 5bf43dd03..a585f235f 100644 --- a/SQF/dayz_code/actions/trade_any_vehicle_free.sqf +++ b/SQF/dayz_code/actions/trade_any_vehicle_free.sqf @@ -188,7 +188,7 @@ if (_finished) then { PVDZ_obj_Destroy = [_objectID,_objectUID,_activatingPlayer,_obj,DZE_AuthKey]; publicVariableServer "PVDZ_obj_Destroy"; - deleteVehicle _obj; + //deleteVehicle _obj; // payout _canAfford = [[[_part_out,_qty_out]],1] call epoch_returnChange; diff --git a/SQF/dayz_code/actions/trade_any_vehicle_old.sqf b/SQF/dayz_code/actions/trade_any_vehicle_old.sqf index fcaaf6f17..106eb054f 100644 --- a/SQF/dayz_code/actions/trade_any_vehicle_old.sqf +++ b/SQF/dayz_code/actions/trade_any_vehicle_old.sqf @@ -166,7 +166,7 @@ if (_qty >= _qty_in) then { PVDZ_obj_Destroy = [_objectID,_objectUID,_activatingPlayer,_obj,DZE_AuthKey]; publicVariableServer "PVDZ_obj_Destroy"; - deleteVehicle _obj; + //deleteVehicle _obj; format[localize "str_epoch_player_181",_qty_in,_textPartIn,_qty_out,_textPartOut] call dayz_rollingMessages; diff --git a/SQF/dayz_code/compile/player_packTent.sqf b/SQF/dayz_code/compile/player_packTent.sqf index 8f594bd23..822504043 100644 --- a/SQF/dayz_code/compile/player_packTent.sqf +++ b/SQF/dayz_code/compile/player_packTent.sqf @@ -55,7 +55,7 @@ if (_ownerID in [dayz_characterID,dayz_playerUID] or typeOf _obj in _campItems) PVDZ_obj_Destroy = [_objectID,_objectUID,player,_obj,DZE_AuthKey]; publicVariableServer "PVDZ_obj_Destroy"; - deleteVehicle _obj; + //deleteVehicle _obj; //Add weapons _objWpnTypes = _weapons select 0; diff --git a/SQF/dayz_code/traps/functions/remove.sqf b/SQF/dayz_code/traps/functions/remove.sqf index 9e4c71bc9..e2645c0f4 100644 --- a/SQF/dayz_code/traps/functions/remove.sqf +++ b/SQF/dayz_code/traps/functions/remove.sqf @@ -12,6 +12,6 @@ if (isServer) then { //For normal remove let object_pickup.sqf perform deletion to ensure player has room in gear first, no others remove at same time and animation runs PVDZ_obj_Destroy = [_objectID,_objectUID,player,_obj,DZE_AuthKey]; publicVariableServer "PVDZ_obj_Destroy"; - deleteVehicle _obj; + //deleteVehicle _obj; }; }; \ No newline at end of file diff --git a/SQF/dayz_server/compile/server_deleteObj.sqf b/SQF/dayz_server/compile/server_deleteObj.sqf index d1e04f62e..53b9b6e3e 100644 --- a/SQF/dayz_server/compile/server_deleteObj.sqf +++ b/SQF/dayz_server/compile/server_deleteObj.sqf @@ -2,7 +2,7 @@ [_objectID,_objectUID,_activatingPlayer,_object,DZE_AuthKey] call server_deleteObj; For PV calls from the client use this function, otherwise if calling directly from the server use server_deleteObjDirect */ -private["_id","_uid","_key","_activatingPlayer","_object","_clientKey","_PlayerUID","_PUIDIndex"]; +private["_id","_uid","_key","_activatingPlayer","_object","_clientKey","_PlayerUID","_PUIDIndex","_processDelete"]; if (count _this < 5) exitWith {diag_log "Server_DeleteObj error: Improper parameter format";}; _id = _this select 0; @@ -10,24 +10,26 @@ _uid = _this select 1; _activatingPlayer = _this select 2; _object = _this select 3; _clientKey = _this select 4; +_processDelete = if (count _this > 5) then {_this select 5} else {true}; _PlayerUID = getPlayerUID _activatingPlayer; _PUIDIndex = DZE_ServerPUIDArray find _PlayerUID; -if (_object distance _activatingPlayer > (Z_VehicleDistance + 10)) exitWith {diag_log "Server_DeleteObj error: Delete verification failed, referenced player is too far away from object";}; -if (_PUIDIndex < 0) exitWith {diag_log "Server_DeleteObj error: PUID NOT FOUND ON SERVER";}; -if ((((DZE_ServerClientKeys select _PUIDIndex) select 0) != (owner _activatingPlayer)) || (((DZE_ServerClientKeys select _PUIDIndex) select 1) != _clientKey)) exitWith {diag_log "Server_DeleteObj error: CLIENT AUTH KEY INCORRECT OR UNRECOGNIZED";}; +if (_object distance _activatingPlayer > (Z_VehicleDistance + 10)) exitWith {diag_log format["Server_DeleteObj error: Delete verification failed, referenced player is too far away from object. PV ARRAY: %1", _this];}; +if (_PUIDIndex < 0) exitWith {diag_log format["Server_DeleteObj error: PUID NOT FOUND ON SERVER. PV ARRAY: %1", _this];}; +if ((((DZE_ServerClientKeys select _PUIDIndex) select 0) != (owner _activatingPlayer)) || (((DZE_ServerClientKeys select _PUIDIndex) select 1) != _clientKey)) exitWith {diag_log format["Server_DeleteObj error: CLIENT AUTH KEY INCORRECT OR UNRECOGNIZED. PV ARRAY: %1", _this];}; if (isServer) then { + if (_processDelete) then {deleteVehicle _object}; //remove from database if (parseNumber _id > 0) then { //Send request _key = format["CHILD:304:%1:",_id]; _key call server_hiveWrite; - diag_log format["DELETE: Player %1 ,with Player UID %2 deleted object with ID: %3",_activatingPlayer, _PlayerUID, _id]; + diag_log format["DELETE: Player %1 with Player UID %2 deleted object with ID: %3",_activatingPlayer, _PlayerUID, _id]; } else { //Send request _key = format["CHILD:310:%1:",_uid]; _key call server_hiveWrite; - diag_log format["DELETE: Player %1 ,with Player UID %2 deleted object with UID: %3",_activatingPlayer, _PlayerUID, _uid]; + diag_log format["DELETE: Player %1 with Player UID %2 deleted object with UID: %3",_activatingPlayer, _PlayerUID, _uid]; }; }; \ No newline at end of file