From c2d2ad29567a48cee4b50623d7b8b7c50ccfafb9 Mon Sep 17 00:00:00 2001 From: ebayShopper Date: Sat, 4 Nov 2017 14:35:51 -0400 Subject: [PATCH] Fix remove.sqf error from e079381 Wrecks were not deleted after removal following this change @icomrade https://github.com/EpochModTeam/DayZ-Epoch/commit/e07938193161ae147523c3a4bae76eecbea787f4#diff-e057d99bdf425219ff82fc6220a85b86L154 In object_upgradeBuilding playerNear was exiting without readding removed magazines. I moved deletion back client side in packTent and upgradeStorage for now, because there is potential for duping via pulling gear out of the old tent during the deletion delay. PVS can be delayed especially when the server is under load, so it can take a few seconds for the server to delete the object after sending the request. These two scripts should be the only ones where that could be problematic. Packing and upgrading tents should eventually be moved completely server side like safes. --- SQF/dayz_code/actions/object_upgradeStorage.sqf | 4 ++-- SQF/dayz_code/actions/object_upgradebuilding.sqf | 8 ++++---- SQF/dayz_code/actions/remove.sqf | 10 +++++----- SQF/dayz_code/compile/player_packTent.sqf | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/SQF/dayz_code/actions/object_upgradeStorage.sqf b/SQF/dayz_code/actions/object_upgradeStorage.sqf index 5c68cdcb5..b26c0aa88 100644 --- a/SQF/dayz_code/actions/object_upgradeStorage.sqf +++ b/SQF/dayz_code/actions/object_upgradeStorage.sqf @@ -128,9 +128,9 @@ if ((_startUpgrade) AND (isClass(_upgradeConfig))) then { _backpacks = getBackpackCargo _cursorTarget; //remove old tent - PVDZ_obj_Destroy = [_objectID,_objectUID,player,_cursorTarget,dayz_authKey]; + PVDZ_obj_Destroy = [_objectID,_objectUID,player,_pos,dayz_authKey,false]; 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 5f706cf44..97517819d 100644 --- a/SQF/dayz_code/actions/object_upgradebuilding.sqf +++ b/SQF/dayz_code/actions/object_upgradebuilding.sqf @@ -8,7 +8,7 @@ */ private ["_nearByChoppers","_cursorTarget","_type","_class","_requiredTools","_requiredParts","_upgradeType","_producedParts","_randomCreate", - "_upgradeClass","_onLadder","_isWater","_ok","_missing","_upgradeParts","_dis","_characterID","_objectID","_objectUID", + "_upgradeClass","_onLadder","_isWater","_ok","_missing","_upgradeParts","_dis","_characterID","_objectID","_objectUID","_playerNear", "_ownerArray","_ownerPasscode","_dir","_vector","_object","_puid","_clanArray","_wh","_variables","_finished"]; _cursorTarget = _this; @@ -42,6 +42,9 @@ _onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animatio _isWater = (surfaceIsWater (getPosATL player)) or dayz_isSwimming; if(_isWater or _onLadder) exitWith { localize "str_water_ladder_cant_do" 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; }; + // lets check player has requiredTools for upgrade _ok = true; _missing = ""; @@ -72,9 +75,6 @@ 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; diff --git a/SQF/dayz_code/actions/remove.sqf b/SQF/dayz_code/actions/remove.sqf index c68b129fd..a5b0de1e2 100644 --- a/SQF/dayz_code/actions/remove.sqf +++ b/SQF/dayz_code/actions/remove.sqf @@ -152,11 +152,12 @@ if (_proceed && _success) then { _ipos = getPosATL _obj; if(!_isWreck && !_isWreckBuilding) then { + //Server performs deleteVehicle PVDZ_obj_Destroy = [_objectID,_objectUID,player,_obj,dayz_authKey]; publicVariableServer "PVDZ_obj_Destroy"; + } else { + deleteVehicle _obj; }; - - //deleteVehicle _obj; if (_isWreckBuilding) then { PVDZ_send = [player,"RemoveObject",_ipos]; @@ -262,7 +263,6 @@ if (_proceed && _success) then { localize "str_epoch_player_91" call dayz_rollingMessages; }; }; -dayz_actionInProgress = false; -s_player_deleteBuild = -1; -_obj +dayz_actionInProgress = false; +s_player_deleteBuild = -1; \ No newline at end of file diff --git a/SQF/dayz_code/compile/player_packTent.sqf b/SQF/dayz_code/compile/player_packTent.sqf index 377211e1d..e701922ff 100644 --- a/SQF/dayz_code/compile/player_packTent.sqf +++ b/SQF/dayz_code/compile/player_packTent.sqf @@ -53,9 +53,9 @@ if (_ownerID in [dayz_characterID,dayz_playerUID] or typeOf _obj in _campItems) _magazines = getMagazineCargo _obj; _backpacks = getBackpackCargo _obj; - PVDZ_obj_Destroy = [_objectID,_objectUID,player,_obj,dayz_authKey]; + PVDZ_obj_Destroy = [_objectID,_objectUID,player,_pos,dayz_authKey,false]; publicVariableServer "PVDZ_obj_Destroy"; - //deleteVehicle _obj; + deleteVehicle _obj; //Add weapons _objWpnTypes = _weapons select 0;