From ce22dbbf858356d9dbbc2bac114c04a62060bb9a Mon Sep 17 00:00:00 2001 From: AirwavesMan Date: Thu, 24 Dec 2020 11:00:16 +0100 Subject: [PATCH] Fix ownership for upgraded lockables --- SQF/dayz_code/actions/player_upgrade.sqf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SQF/dayz_code/actions/player_upgrade.sqf b/SQF/dayz_code/actions/player_upgrade.sqf index c15be4f98..def74145f 100644 --- a/SQF/dayz_code/actions/player_upgrade.sqf +++ b/SQF/dayz_code/actions/player_upgrade.sqf @@ -5,7 +5,7 @@ if (dayz_actionInProgress) exitWith {localize "str_epoch_player_52" call dayz_rollingMessages;}; dayz_actionInProgress = true; -private ["_location","_dir","_classname","_missing","_text","_proceed","_num_removed","_object","_missingQty","_itemIn","_countIn","_qty","_removed","_removed_total","_tobe_removed_total","_objectID","_objectUID","_temp_removed_array","_textMissing","_newclassname","_requirements","_obj","_upgrade","_lockable","_combination_1","_combination_2","_combination_3","_combination","_objectCharacterID","_ownerID","_qtyBP","_bpMags","_countNew","_bp2Remove","_count","_friendsArr","_vector","_temp_BP_removed_array","_finished","_neededTools"]; +private ["_location","_dir","_classname","_hasAcces","_missing","_text","_proceed","_num_removed","_object","_missingQty","_itemIn","_countIn","_qty","_removed","_removed_total","_tobe_removed_total","_objectID","_objectUID","_temp_removed_array","_textMissing","_newclassname","_requirements","_obj","_upgrade","_lockable","_combination_1","_combination_2","_combination_3","_combination","_objectCharacterID","_ownerID","_qtyBP","_bpMags","_countNew","_bp2Remove","_count","_friendsArr","_vector","_temp_BP_removed_array","_finished","_neededTools"]; player removeAction s_player_upgrade_build; s_player_upgrade_build = 1; @@ -17,6 +17,9 @@ _classname = typeOf _obj; if ((_objectID == "0" && {_objectUID == "0"}) || _classname in DZE_DisableUpgrade) exitWith {dayz_actionInProgress = false; s_player_upgrade_build = -1; localize "str_epoch_player_50" call dayz_rollingMessages;}; +_hasAccess = [player, _obj] call FNC_check_access; +if (_classname in DZE_LockedStorage && !(_hasAccess select 0)) exitWith {dayz_actionInProgress = false;localize "STR_CL_EC_NOT_OWNER" call dayz_rollingMessages;}; + _text = getText (configFile >> "CfgVehicles" >> _classname >> "displayName"); _upgrade = getArray (configFile >> "CfgVehicles" >> _classname >> "upgradeBuilding");