From 6db5daa4a499fc429f64780520fc41744323ba9c Mon Sep 17 00:00:00 2001 From: "[VB]AWOL" Date: Mon, 25 Nov 2013 12:38:01 -0600 Subject: [PATCH] thirst and hunger loss on unlocking safes/doors --- SQF/dayz_code/compile/player_unlockDoor.sqf | 9 ++++++++- SQF/dayz_code/compile/player_unlockVault.sqf | 2 ++ SQF/dayz_code/init/compiles.sqf | 5 +++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/SQF/dayz_code/compile/player_unlockDoor.sqf b/SQF/dayz_code/compile/player_unlockDoor.sqf index c9fc46e4b..7b73e5495 100644 --- a/SQF/dayz_code/compile/player_unlockDoor.sqf +++ b/SQF/dayz_code/compile/player_unlockDoor.sqf @@ -5,6 +5,12 @@ */ private ["_display","_obj","_objectCharacterID"]; +if(!isNil "DZE_DYN_UnlockDoorInprogress") exitWith { cutText [(localize "str_epoch_player_21") , "PLAIN DOWN"]; }; + +DZE_DYN_UnlockDoorInprogress = true; + +[1,1] call dayz_HungerThirst; + if(!isNull dayz_selectedDoor) then { if (!isNil 'KeyCodeTryTimer') then { @@ -74,4 +80,5 @@ if(!isNull dayz_selectedDoor) then { // close display since no target _display = findDisplay 41144; _display closeDisplay 3000; -}; \ No newline at end of file +}; +DZE_DYN_UnlockDoorInprogress = nil; \ No newline at end of file diff --git a/SQF/dayz_code/compile/player_unlockVault.sqf b/SQF/dayz_code/compile/player_unlockVault.sqf index da9cca837..33d5215c8 100644 --- a/SQF/dayz_code/compile/player_unlockVault.sqf +++ b/SQF/dayz_code/compile/player_unlockVault.sqf @@ -8,6 +8,8 @@ private ["_objectID","_objectUID","_obj","_ownerID","_dir","_pos","_holder","_we if(TradeInprogress) exitWith { cutText [(localize "str_epoch_player_21") , "PLAIN DOWN"]; }; TradeInprogress = true; +[1,1] call dayz_HungerThirst; + {player removeAction _x} forEach s_player_combi;s_player_combi = []; s_player_unlockvault = 1; diff --git a/SQF/dayz_code/init/compiles.sqf b/SQF/dayz_code/init/compiles.sqf index f02834baa..07e3f3f2e 100644 --- a/SQF/dayz_code/init/compiles.sqf +++ b/SQF/dayz_code/init/compiles.sqf @@ -498,6 +498,11 @@ if (!isDedicated) then { spawn_loot_small = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\spawn_loot_small.sqf"; // player_projectileNear = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_projectileNear.sqf"; + dayz_HungerThirst = { + dayz_hunger = dayz_hunger + (_this select 0); + dayz_thirst = dayz_thirst + (_this select 1); + }; + player_sumMedical = { private["_character","_wounds","_legs","_arms","_medical"]; _character = _this;