Fix remove.sqf error from e079381

Wrecks were not deleted after removal following this change @icomrade

e079381931 (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.
This commit is contained in:
ebayShopper
2017-11-04 14:35:51 -04:00
parent 4570c96f7f
commit c2d2ad2956
4 changed files with 13 additions and 13 deletions

View File

@@ -128,9 +128,9 @@ if ((_startUpgrade) AND (isClass(_upgradeConfig))) then {
_backpacks = getBackpackCargo _cursorTarget; _backpacks = getBackpackCargo _cursorTarget;
//remove old tent //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"; publicVariableServer "PVDZ_obj_Destroy";
//deleteVehicle _cursorTarget; deleteVehicle _cursorTarget;
// remove parts from players inventory before creation of new tent. // remove parts from players inventory before creation of new tent.
{ {

View File

@@ -8,7 +8,7 @@
*/ */
private ["_nearByChoppers","_cursorTarget","_type","_class","_requiredTools","_requiredParts","_upgradeType","_producedParts","_randomCreate", 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"]; "_ownerArray","_ownerPasscode","_dir","_vector","_object","_puid","_clanArray","_wh","_variables","_finished"];
_cursorTarget = _this; _cursorTarget = _this;
@@ -42,6 +42,9 @@ _onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animatio
_isWater = (surfaceIsWater (getPosATL player)) or dayz_isSwimming; _isWater = (surfaceIsWater (getPosATL player)) or dayz_isSwimming;
if(_isWater or _onLadder) exitWith { localize "str_water_ladder_cant_do" call dayz_rollingMessages; }; 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 // lets check player has requiredTools for upgrade
_ok = true; _ok = true;
_missing = ""; _missing = "";
@@ -72,9 +75,6 @@ if (!_ok) exitWith {
format [localize "str_upgradeMissingPart", _missing] call dayz_rollingMessages; 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 { if (dayz_actionInProgress) exitWith {
{ player addMagazine _x; } forEach _upgradeParts; { player addMagazine _x; } forEach _upgradeParts;
localize "str_player_actionslimit" call dayz_rollingMessages; localize "str_player_actionslimit" call dayz_rollingMessages;

View File

@@ -152,11 +152,12 @@ if (_proceed && _success) then {
_ipos = getPosATL _obj; _ipos = getPosATL _obj;
if(!_isWreck && !_isWreckBuilding) then { if(!_isWreck && !_isWreckBuilding) then {
//Server performs deleteVehicle
PVDZ_obj_Destroy = [_objectID,_objectUID,player,_obj,dayz_authKey]; PVDZ_obj_Destroy = [_objectID,_objectUID,player,_obj,dayz_authKey];
publicVariableServer "PVDZ_obj_Destroy"; publicVariableServer "PVDZ_obj_Destroy";
} else {
deleteVehicle _obj;
}; };
//deleteVehicle _obj;
if (_isWreckBuilding) then { if (_isWreckBuilding) then {
PVDZ_send = [player,"RemoveObject",_ipos]; PVDZ_send = [player,"RemoveObject",_ipos];
@@ -262,7 +263,6 @@ if (_proceed && _success) then {
localize "str_epoch_player_91" call dayz_rollingMessages; localize "str_epoch_player_91" call dayz_rollingMessages;
}; };
}; };
dayz_actionInProgress = false;
s_player_deleteBuild = -1;
_obj dayz_actionInProgress = false;
s_player_deleteBuild = -1;

View File

@@ -53,9 +53,9 @@ if (_ownerID in [dayz_characterID,dayz_playerUID] or typeOf _obj in _campItems)
_magazines = getMagazineCargo _obj; _magazines = getMagazineCargo _obj;
_backpacks = getBackpackCargo _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"; publicVariableServer "PVDZ_obj_Destroy";
//deleteVehicle _obj; deleteVehicle _obj;
//Add weapons //Add weapons
_objWpnTypes = _weapons select 0; _objWpnTypes = _weapons select 0;