mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-06-28 04:31:55 +03:00
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.
This commit is contained in:
@@ -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.
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user