From a6cb29aa7e972d096f889b8b1d77aa29bfd18bba Mon Sep 17 00:00:00 2001 From: ebaydayz Date: Sat, 15 Oct 2016 12:04:44 -0400 Subject: [PATCH] Prevent spamming sleep on tent Vanilla commit: https://github.com/DayZMod/DayZ/commit/e9df65bc56eff371a2f40209ee7b5c339a6c05f3 --- SQF/dayz_code/actions/player_sleep.sqf | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/SQF/dayz_code/actions/player_sleep.sqf b/SQF/dayz_code/actions/player_sleep.sqf index 8a596f86b..473f7644c 100644 --- a/SQF/dayz_code/actions/player_sleep.sqf +++ b/SQF/dayz_code/actions/player_sleep.sqf @@ -9,9 +9,11 @@ _sleepArray = ["aidlppnemstpsnonwnondnon_sleepc_laydown","aidlppnemstpsnonwnondn //_playArray = _sleepArray call BIS_fnc_selectRandom; player playmove "AidlPpneMstpSnonWnonDnon_SleepC_sleep"; -if (r_action) exitwith {}; +_sleeping = player getVariable ["sleeping",false]; -r_action = true; +if (_sleeping) exitwith {}; + +player setVariable ["sleeping",true]; r_interrupt = false; _animState = animationState player; @@ -102,7 +104,7 @@ if (r_interrupt) then { player playActionNow "stop"; }; -r_action = false; +player setVariable ["sleeping",false]; //Removed due to player sync returning [] //PVDZ_plr_Save = [player,nil,true,dayz_playerAchievements];