mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 12:12:34 +03:00
Revert "Only allow lock removal if door is unlocked"
This reverts commit b8dba25
As discussed with oiad on Discord, this serves no purpose now, since
DZE_lockDoor == charID means the player either just unlocked, built,
upgraded or downgraded the door, so they want to see the action.
Logically a combo lock can be removed while a door is open. In case of
it being locked, you already know the code, so it is assumed you put it
in before removing it. Completing two-three steps at once is more
convenient for the player.
Also removed _isDestructable because there are no classes which inherit
from "BuiltItems" and have a lock
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
* @param String _this select 2 (_extraText) -> Indicator what container you are trading from
|
||||
* @param Array of Strings _this select 3 (_bags) -> all backpacks in the container
|
||||
*
|
||||
* Fills up the sell or buy list if the item has a valid config.
|
||||
* Fills up the sellable list if the item has a valid config.
|
||||
**/
|
||||
private ["_weaps","_mags","_extraText","_arrayOfTraderCat","_totalPrice","_backUpText","_bags","_baseVehicle","_currencyQty","_swap","_swap2","_myVehType"];
|
||||
#include "defines.hpp"
|
||||
@@ -24,7 +24,7 @@ _HasKeyCheck = {
|
||||
private ["_objectCharacterID","_keyFound","_tempKeys"];
|
||||
|
||||
_keyFound = false;
|
||||
_objectCharacterId = DZE_myVehicle getVariable ["CharacterID","0"];
|
||||
_objectCharacterId = DZE_myVehicle getVariable ["CharacterID","0"];
|
||||
if (_objectCharacterId == "0") then {
|
||||
_keyFound = true;
|
||||
} else {
|
||||
|
||||
@@ -13,7 +13,7 @@ private ["_canPickLight","_text","_unlock","_lock","_totalKeys","_temp_keys","_t
|
||||
"_isModular","_isModularDoor","_isHouse","_isGateOperational","_isGateLockable","_isFence","_isLockableGate","_isUnlocked","_isOpen","_isClosed","_ownerArray","_ownerBuildLock",
|
||||
"_ownerPID","_speed","_dog","_vehicle","_inVehicle","_cursorTarget","_primaryWeapon","_currentWeapon","_magazinesPlayer","_onLadder","_canDo",
|
||||
"_nearLight","_vehicleOwnerID","_hasHotwireKit","_isPZombie","_dogHandle","_allowedDistance","_id","_upgrade","_weaponsPlayer","_hasCrowbar",
|
||||
"_allowed","_hasAccess","_uid","_myCharID","_isLocked","_isDoorUnlocked"];
|
||||
"_allowed","_hasAccess","_uid","_myCharID","_isLocked"];
|
||||
|
||||
_vehicle = vehicle player;
|
||||
_inVehicle = (_vehicle != player);
|
||||
@@ -839,15 +839,14 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur
|
||||
};
|
||||
|
||||
// downgrade system
|
||||
if ((DZE_Lock_Door == _characterID) && {!keypadCancel} && {_isDestructable || _cursorTarget isKindOf "Land_DZE_WoodDoorLocked_Base" || _cursorTarget isKindOf "CinderWallDoorLocked_DZ_Base"}) then {
|
||||
if (DZE_Lock_Door == _characterID && {!keypadCancel} && {_cursorTarget isKindOf "Land_DZE_WoodDoorLocked_Base" || _cursorTarget isKindOf "CinderWallDoorLocked_DZ_Base"}) then {
|
||||
if ((s_player_lastTarget select 1) != _cursorTarget) then {
|
||||
if (s_player_downgrade_build > 0) then {
|
||||
player removeAction s_player_downgrade_build;
|
||||
s_player_downgrade_build = -1;
|
||||
};
|
||||
};
|
||||
_isDoorUnlocked = ((_cursorTarget animationPhase "Open_door" == 0) && {(_cursorTarget animationPhase "Open_hinge" == 1) || (_cursorTarget animationPhase "Open_latch" == 1)});
|
||||
if (s_player_downgrade_build < 0 && _isDoorUnlocked) then {
|
||||
if (s_player_downgrade_build < 0) then {
|
||||
_hasAccess = [player, _cursorTarget] call FNC_check_access;
|
||||
if ((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3)) then {
|
||||
s_player_lastTarget set [1,_cursorTarget];
|
||||
|
||||
Reference in New Issue
Block a user