From fb2bf9462d0e93b58ad858a898c75546dbf63950 Mon Sep 17 00:00:00 2001 From: A Man Date: Tue, 12 Apr 2022 11:35:24 +0200 Subject: [PATCH] Fix door penalty when door management was off DZE_doorManagementHarderPenalty had no effect when the door management was disabled. Thanks @IsGoose for pointing that out --- .../CfgVehicles/Buildables/Bridges.hpp | 2 +- .../Configs/CfgVehicles/Buildables/Doors.hpp | 22 +++++++++---------- .../CfgVehicles/Buildables/FencesGates.hpp | 8 +++---- .../Buildables/ModularBuildCinder.hpp | 4 ++-- SQF/dayz_code/compile/player_unlockDoor.sqf | 7 +++--- SQF/dayz_code/stringtable.xml | 8 +++++++ 6 files changed, 30 insertions(+), 21 deletions(-) diff --git a/SQF/dayz_code/Configs/CfgVehicles/Buildables/Bridges.hpp b/SQF/dayz_code/Configs/CfgVehicles/Buildables/Bridges.hpp index d4b92df35..ddaba71ad 100644 --- a/SQF/dayz_code/Configs/CfgVehicles/Buildables/Bridges.hpp +++ b/SQF/dayz_code/Configs/CfgVehicles/Buildables/Bridges.hpp @@ -102,7 +102,7 @@ class Metal_DrawbridgeLocked_DZ: CinderWallDoorLocked_DZ_Base { displayName = $STR_EPOCH_ACTION_UNLOCK_BRIDGE; condition = "!keypadCancel and DZE_Lock_Door != (this getvariable['CharacterID','0'])"; - statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog ""DoorAccess"";} else {createdialog ""ComboLockUI"";};"; + statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog 'DoorAccess';} else {if (DZE_doorManagementHarderPenalty && {dayz_lastCodeFail > diag_tickTime}) then {format [localize 'STR_EPOCH_PLAYER_19_WAIT',round(dayz_lastCodeFail - diag_tickTime)] call dayz_rollingMessages;} else {createdialog 'ComboLockUI';};};"; }; }; }; \ No newline at end of file diff --git a/SQF/dayz_code/Configs/CfgVehicles/Buildables/Doors.hpp b/SQF/dayz_code/Configs/CfgVehicles/Buildables/Doors.hpp index 030d26be7..d295ff446 100644 --- a/SQF/dayz_code/Configs/CfgVehicles/Buildables/Doors.hpp +++ b/SQF/dayz_code/Configs/CfgVehicles/Buildables/Doors.hpp @@ -275,7 +275,7 @@ class Land_DZE_WoodDoorLocked: Land_DZE_WoodDoorLocked_Base { { displayName = $STR_EPOCH_DOORS_UNLOCK; condition = "!keypadCancel and DZE_Lock_Door != (this getvariable['CharacterID','0'])"; - statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog ""DoorAccess"";} else {createdialog ""ComboLockUI"";};"; + statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog 'DoorAccess';} else {if (DZE_doorManagementHarderPenalty && {dayz_lastCodeFail > diag_tickTime}) then {format [localize 'STR_EPOCH_PLAYER_19_WAIT',round(dayz_lastCodeFail - diag_tickTime)] call dayz_rollingMessages;} else {createdialog 'ComboLockUI';};};"; }; }; }; @@ -366,7 +366,7 @@ class Land_DZE_LargeWoodDoorLocked: Land_DZE_WoodDoorLocked_Base { { displayName = $STR_EPOCH_DOORS_UNLOCK; condition = "!keypadCancel and DZE_Lock_Door != (this getvariable['CharacterID','0'])"; - statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog ""DoorAccess"";} else {createdialog ""ComboLockUI"";};"; + statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog 'DoorAccess';} else {if (DZE_doorManagementHarderPenalty && {dayz_lastCodeFail > diag_tickTime}) then {format [localize 'STR_EPOCH_PLAYER_19_WAIT',round(dayz_lastCodeFail - diag_tickTime)] call dayz_rollingMessages;} else {createdialog 'ComboLockUI';};};"; }; }; }; @@ -459,7 +459,7 @@ class Land_DZE_GarageWoodDoorLocked: Land_DZE_WoodDoorLocked_Base { { displayName = $STR_EPOCH_DOORS_UNLOCK; condition = "!keypadCancel and DZE_Lock_Door != (this getvariable['CharacterID','0'])"; - statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog ""DoorAccess"";} else {createdialog ""ComboLockUI"";};"; + statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog 'DoorAccess';} else {if (DZE_doorManagementHarderPenalty && {dayz_lastCodeFail > diag_tickTime}) then {format [localize 'STR_EPOCH_PLAYER_19_WAIT',round(dayz_lastCodeFail - diag_tickTime)] call dayz_rollingMessages;} else {createdialog 'ComboLockUI';};};"; }; }; }; @@ -577,7 +577,7 @@ class Land_DZE_WoodGateLocked: Land_DZE_WoodDoorLocked_Base { { displayName = $STR_BLD_ACTIONS_UNLOCKGATE; condition = "!keypadCancel and DZE_Lock_Door != (this getvariable['CharacterID','0'])"; - statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog ""DoorAccess"";} else {createdialog ""ComboLockUI"";};"; + statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog 'DoorAccess';} else {if (DZE_doorManagementHarderPenalty && {dayz_lastCodeFail > diag_tickTime}) then {format [localize 'STR_EPOCH_PLAYER_19_WAIT',round(dayz_lastCodeFail - diag_tickTime)] call dayz_rollingMessages;} else {createdialog 'ComboLockUI';};};"; }; }; class DestructionEffects : DestructionEffects { @@ -703,7 +703,7 @@ class Land_DZE_WoodOpenTopGarageLocked: Land_DZE_WoodDoorLocked_Base { { displayName = $STR_EPOCH_DOORS_UNLOCK; condition = "!keypadCancel and DZE_Lock_Door != (this getvariable['CharacterID','0'])"; - statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog ""DoorAccess"";} else {createdialog ""ComboLockUI"";};"; + statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog 'DoorAccess';} else {if (DZE_doorManagementHarderPenalty && {dayz_lastCodeFail > diag_tickTime}) then {format [localize 'STR_EPOCH_PLAYER_19_WAIT',round(dayz_lastCodeFail - diag_tickTime)] call dayz_rollingMessages;} else {createdialog 'ComboLockUI';};};"; }; }; class DestructionEffects : DestructionEffects { @@ -771,7 +771,7 @@ class CinderWallDoorLocked_DZ: CinderWallDoorLocked_DZ_Base { { displayName = $STR_EPOCH_DOORS_UNLOCK; condition = "!keypadCancel and DZE_Lock_Door != (this getvariable['CharacterID','0'])"; - statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog ""DoorAccess"";} else {createdialog ""ComboLockUI"";};"; + statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog 'DoorAccess';} else {if (DZE_doorManagementHarderPenalty && {dayz_lastCodeFail > diag_tickTime}) then {format [localize 'STR_EPOCH_PLAYER_19_WAIT',round(dayz_lastCodeFail - diag_tickTime)] call dayz_rollingMessages;} else {createdialog 'ComboLockUI';};};"; }; }; }; @@ -864,7 +864,7 @@ class CinderWallDoorSmallLocked_DZ: CinderWallDoorLocked_DZ_Base { { displayName = $STR_EPOCH_DOORS_UNLOCK; condition = "!keypadCancel and DZE_Lock_Door != (this getvariable['CharacterID','0'])"; - statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog ""DoorAccess"";} else {createdialog ""ComboLockUI"";};"; + statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog 'DoorAccess';} else {if (DZE_doorManagementHarderPenalty && {dayz_lastCodeFail > diag_tickTime}) then {format [localize 'STR_EPOCH_PLAYER_19_WAIT',round(dayz_lastCodeFail - diag_tickTime)] call dayz_rollingMessages;} else {createdialog 'ComboLockUI';};};"; }; }; }; @@ -1007,7 +1007,7 @@ class CinderGateLocked_DZ: CinderWallDoorLocked_DZ_Base { { displayName = $STR_BLD_ACTIONS_UNLOCKGATE; condition = "!keypadCancel and DZE_Lock_Door != (this getvariable['CharacterID','0'])"; - statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog ""DoorAccess"";} else {createdialog ""ComboLockUI"";};"; + statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog 'DoorAccess';} else {if (DZE_doorManagementHarderPenalty && {dayz_lastCodeFail > diag_tickTime}) then {format [localize 'STR_EPOCH_PLAYER_19_WAIT',round(dayz_lastCodeFail - diag_tickTime)] call dayz_rollingMessages;} else {createdialog 'ComboLockUI';};};"; }; }; }; @@ -1113,7 +1113,7 @@ class CinderGarageOpenTopLocked_DZ: CinderWallDoorLocked_DZ_Base { { displayName = $STR_EPOCH_DOORS_UNLOCK; condition = "!keypadCancel and DZE_Lock_Door != (this getvariable['CharacterID','0'])"; - statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog ""DoorAccess"";} else {createdialog ""ComboLockUI"";};"; + statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog 'DoorAccess';} else {if (DZE_doorManagementHarderPenalty && {dayz_lastCodeFail > diag_tickTime}) then {format [localize 'STR_EPOCH_PLAYER_19_WAIT',round(dayz_lastCodeFail - diag_tickTime)] call dayz_rollingMessages;} else {createdialog 'ComboLockUI';};};"; }; }; }; @@ -1219,7 +1219,7 @@ class CinderDoorHatchLocked_DZ: CinderWallDoorLocked_DZ_Base { { displayName = $STR_EPOCH_DOORS_UNLOCK; condition = "!keypadCancel and DZE_Lock_Door != (this getvariable['CharacterID','0'])"; - statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog ""DoorAccess"";} else {createdialog ""ComboLockUI"";};"; + statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog 'DoorAccess';} else {if (DZE_doorManagementHarderPenalty && {dayz_lastCodeFail > diag_tickTime}) then {format [localize 'STR_EPOCH_PLAYER_19_WAIT',round(dayz_lastCodeFail - diag_tickTime)] call dayz_rollingMessages;} else {createdialog 'ComboLockUI';};};"; }; }; }; @@ -1340,7 +1340,7 @@ class DoorLocked_DZ: CinderWallDoorLocked_DZ_Base { { displayName = $STR_EPOCH_DOORS_UNLOCK; condition = "!keypadCancel and DZE_Lock_Door != (this getvariable['CharacterID','0'])"; - statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog ""DoorAccess"";} else {createdialog ""ComboLockUI"";};"; + statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog 'DoorAccess';} else {if (DZE_doorManagementHarderPenalty && {dayz_lastCodeFail > diag_tickTime}) then {format [localize 'STR_EPOCH_PLAYER_19_WAIT',round(dayz_lastCodeFail - diag_tickTime)] call dayz_rollingMessages;} else {createdialog 'ComboLockUI';};};"; }; }; class DestructionEffects { diff --git a/SQF/dayz_code/Configs/CfgVehicles/Buildables/FencesGates.hpp b/SQF/dayz_code/Configs/CfgVehicles/Buildables/FencesGates.hpp index e07ca4be3..e2f3bc8cd 100644 --- a/SQF/dayz_code/Configs/CfgVehicles/Buildables/FencesGates.hpp +++ b/SQF/dayz_code/Configs/CfgVehicles/Buildables/FencesGates.hpp @@ -73,7 +73,7 @@ class WoodenGate_1_DZ: DZE_Housebase priority = 6; displayName = $STR_BLD_ACTIONS_UNLOCKGATE; condition = "!keypadCancel && (DZE_Lock_Door != (this getvariable['CharacterID','0'])) && (this animationPhase ""DoorR"" == 0)"; - statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog ""DoorAccess"";} else {createdialog ""ComboLockUI"";};"; + statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog 'DoorAccess';} else {if (DZE_doorManagementHarderPenalty && {dayz_lastCodeFail > diag_tickTime}) then {format [localize 'STR_EPOCH_PLAYER_19_WAIT',round(dayz_lastCodeFail - diag_tickTime)] call dayz_rollingMessages;} else {createdialog 'ComboLockUI';};};"; }; }; @@ -135,7 +135,7 @@ class WoodenGate_2_DZ: DZE_Housebase priority = 6; displayName = $STR_BLD_ACTIONS_UNLOCKGATE; condition = "!keypadCancel && (DZE_Lock_Door != (this getvariable['CharacterID','0'])) && (this animationPhase ""DoorR"" == 0)"; - statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog ""DoorAccess"";} else {createdialog ""ComboLockUI"";};"; + statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog 'DoorAccess';} else {if (DZE_doorManagementHarderPenalty && {dayz_lastCodeFail > diag_tickTime}) then {format [localize 'STR_EPOCH_PLAYER_19_WAIT',round(dayz_lastCodeFail - diag_tickTime)] call dayz_rollingMessages;} else {createdialog 'ComboLockUI';};};"; }; }; @@ -197,7 +197,7 @@ class WoodenGate_3_DZ: DZE_Housebase priority = 6; displayName = $STR_BLD_ACTIONS_UNLOCKGATE; condition = "!keypadCancel && (DZE_Lock_Door != (this getvariable['CharacterID','0'])) && (this animationPhase ""DoorR"" == 0)"; - statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog ""DoorAccess"";} else {createdialog ""ComboLockUI"";};"; + statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog 'DoorAccess';} else {if (DZE_doorManagementHarderPenalty && {dayz_lastCodeFail > diag_tickTime}) then {format [localize 'STR_EPOCH_PLAYER_19_WAIT',round(dayz_lastCodeFail - diag_tickTime)] call dayz_rollingMessages;} else {createdialog 'ComboLockUI';};};"; }; }; @@ -258,7 +258,7 @@ class WoodenGate_4_DZ: DZE_Housebase priority = 6; displayName = $STR_BLD_ACTIONS_UNLOCKGATE; condition = "!keypadCancel && (DZE_Lock_Door != (this getvariable['CharacterID','0'])) && (this animationPhase ""DoorR"" == 0)"; - statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog ""DoorAccess"";} else {createdialog ""ComboLockUI"";};"; + statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog 'DoorAccess';} else {if (DZE_doorManagementHarderPenalty && {dayz_lastCodeFail > diag_tickTime}) then {format [localize 'STR_EPOCH_PLAYER_19_WAIT',round(dayz_lastCodeFail - diag_tickTime)] call dayz_rollingMessages;} else {createdialog 'ComboLockUI';};};"; }; }; diff --git a/SQF/dayz_code/Configs/CfgVehicles/Buildables/ModularBuildCinder.hpp b/SQF/dayz_code/Configs/CfgVehicles/Buildables/ModularBuildCinder.hpp index fd6f24d31..30db6e615 100644 --- a/SQF/dayz_code/Configs/CfgVehicles/Buildables/ModularBuildCinder.hpp +++ b/SQF/dayz_code/Configs/CfgVehicles/Buildables/ModularBuildCinder.hpp @@ -177,7 +177,7 @@ class CinderWallWindowLocked_DZ: CinderWallDoorLocked_DZ_Base { { displayName = $STR_BLD_ACTIONS_UNLOCK_WINDOW; condition = "!keypadCancel and DZE_Lock_Door != (this getvariable['CharacterID','0'])"; - statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog ""DoorAccess"";} else {createdialog ""ComboLockUI"";};"; + statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog 'DoorAccess';} else {if (DZE_doorManagementHarderPenalty && {dayz_lastCodeFail > diag_tickTime}) then {format [localize 'STR_EPOCH_PLAYER_19_WAIT',round(dayz_lastCodeFail - diag_tickTime)] call dayz_rollingMessages;} else {createdialog 'ComboLockUI';};};"; }; }; }; @@ -371,7 +371,7 @@ class Concrete_Bunker_Locked_DZ: CinderWallDoorLocked_DZ_Base { { displayName = $STR_BLD_ACTIONS_UNLOCK_BUNKER; condition = "!keypadCancel and DZE_Lock_Door != (this getvariable['CharacterID','0'])"; - statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog ""DoorAccess"";} else {createdialog ""ComboLockUI"";};"; + statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog 'DoorAccess';} else {if (DZE_doorManagementHarderPenalty && {dayz_lastCodeFail > diag_tickTime}) then {format [localize 'STR_EPOCH_PLAYER_19_WAIT',round(dayz_lastCodeFail - diag_tickTime)] call dayz_rollingMessages;} else {createdialog 'ComboLockUI';};};"; }; }; }; \ No newline at end of file diff --git a/SQF/dayz_code/compile/player_unlockDoor.sqf b/SQF/dayz_code/compile/player_unlockDoor.sqf index 7ec981948..5e9589594 100644 --- a/SQF/dayz_code/compile/player_unlockDoor.sqf +++ b/SQF/dayz_code/compile/player_unlockDoor.sqf @@ -7,7 +7,7 @@ if (dayz_actionInProgress) exitWith {localize "str_epoch_player_21" call dayz_rollingMessages;}; dayz_actionInProgress = true; -private ["_display","_displayCombo","_displayEye","_doorMethod","_hasAccess","_notNearestPlayer","_obj","_objectCharacterID","_code"]; +private ["_msg","_display","_displayCombo","_displayEye","_doorMethod","_hasAccess","_notNearestPlayer","_obj","_objectCharacterID","_code"]; _doorMethod = ""; _displayCombo = findDisplay 41144; @@ -83,11 +83,12 @@ if (!isNull dayz_selectedDoor) then { if (DZE_doorManagementHarderPenalty) then { dayz_lastCodeFail = (diag_tickTime + dayz_UnlockTime); dayz_UnlockTime = dayz_UnlockTime * 2; + _msg = format [localize "str_epoch_player_19",round(dayz_lastCodeFail - diag_tickTime)]; } else { - dayz_lastCodeFail = (diag_tickTime + dayz_UnlockTime); + _msg = localize "str_epoch_player_19_1"; }; - format [localize "str_epoch_player_19",round(dayz_lastCodeFail - diag_tickTime)] call dayz_rollingMessages; + _msg call dayz_rollingMessages; _display closeDisplay 2; }; }; diff --git a/SQF/dayz_code/stringtable.xml b/SQF/dayz_code/stringtable.xml index 0b07284cc..9a63bd481 100644 --- a/SQF/dayz_code/stringtable.xml +++ b/SQF/dayz_code/stringtable.xml @@ -23319,6 +23319,14 @@ Trop d'erreurs avec le code, patientez %1 secondes Mnohokrát jsi zadal špatný kód, musíš počkat %1 vteřin + + You entered the wrong code. + Du hast einen falschen Code eingegeben. + Вы несколько раз ввели неправильный код. + Je hebt te vaak een foute code ingevoerd. + Trop d'erreurs avec le code. + Mnohokrát jsi zadal špatný kód. + You must wait another %1 seconds before you can enter another code. Du musst weitere %1 Sekunden warten, bevor du einen anderen Code eingeben kannst.