From e412774b0780cc37a2a24a5efdce4321285071bc Mon Sep 17 00:00:00 2001 From: He-Man Date: Mon, 23 Mar 2020 19:43:06 +0100 Subject: [PATCH] Several smaller fixes --- Sources/epoch_code/compile/EPOCH_AutoRun_Check.sqf | 3 +++ .../compile/event_handlers/EPOCH_HandleDamage.sqf | 13 +++++++++++-- Sources/epoch_config/Configs/CfgEpochClient.hpp | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Sources/epoch_code/compile/EPOCH_AutoRun_Check.sqf b/Sources/epoch_code/compile/EPOCH_AutoRun_Check.sqf index e101ea1a..c55c56f1 100644 --- a/Sources/epoch_code/compile/EPOCH_AutoRun_Check.sqf +++ b/Sources/epoch_code/compile/EPOCH_AutoRun_Check.sqf @@ -22,6 +22,9 @@ _canAutoRun = true; if !(alive player) exitwith { false }; +if (lifeState player == "INCAPACITATED") exitwith { + false +}; /* if !(istouchingground player) exitwith { false diff --git a/Sources/epoch_code/compile/event_handlers/EPOCH_HandleDamage.sqf b/Sources/epoch_code/compile/event_handlers/EPOCH_HandleDamage.sqf index 586f4edf..1b138cfc 100644 --- a/Sources/epoch_code/compile/event_handlers/EPOCH_HandleDamage.sqf +++ b/Sources/epoch_code/compile/event_handlers/EPOCH_HandleDamage.sqf @@ -13,11 +13,16 @@ https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/EPOCH_HandleDamage.sqf */ params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"]; + +_this call EPOCH_custom_EH_HandleDamage; + if !(_source isEqualTo _unit) then { - if ((missionnamespace getvariable ["EPOCH_HandleDamageTimeOut",diag_ticktime]) > diag_ticktime) exitwith {}; // prevent multiple actions here - EPOCH_HandleDamageTimeOut = diag_ticktime + 0.1; + if ((missionnamespace getvariable ["EPOCH_HandleDamageTimeOut",diag_ticktime]) - diag_ticktime > 5) exitwith {_damage = 1;}; switch _projectile do { case "B_EnergyPack": { + _damage = 0; + if ((missionnamespace getvariable ["EPOCH_HandleDamageTimeOut",diag_ticktime]) > diag_ticktime) exitwith {}; // prevent multiple actions here + EPOCH_HandleDamageTimeOut = diag_ticktime + 0.1; if (_source distance _unit > 10) exitwith {}; if !(missionnamespace getvariable ["EPOCH_OldRevive",false]) then { _attachments = handgunItems _source; @@ -58,6 +63,9 @@ if !(_source isEqualTo _unit) then { case "bbag_pvc"; case "xbow_tranq"; case "tranq_dart": { + _damage = 0; + if ((missionnamespace getvariable ["EPOCH_HandleDamageTimeOut",diag_ticktime]) > diag_ticktime) exitwith {}; // prevent multiple actions here + EPOCH_HandleDamageTimeOut = diag_ticktime + 0.1; if !(lifeState _unit == "INCAPACITATED") then { EPOCH_HandleDamageTimeOut = diag_ticktime + 1; _unit setUnconscious true; @@ -69,6 +77,7 @@ if !(_source isEqualTo _unit) then { case "B_Swing"; case "B_Stick"; case "B_Hatchet": { + if ((missionnamespace getvariable ["EPOCH_HandleDamageTimeOut",diag_ticktime]) > diag_ticktime) exitwith {}; // prevent multiple actions here if !(lifeState _unit == "INCAPACITATED") then { if ((random 100) < (["CfgEpochClient", "UnconsciousChance", 30] call EPOCH_fnc_returnConfigEntryV2)) then { EPOCH_HandleDamageTimeOut = diag_ticktime + 1; diff --git a/Sources/epoch_config/Configs/CfgEpochClient.hpp b/Sources/epoch_config/Configs/CfgEpochClient.hpp index ddbd3ae0..e387d8df 100644 --- a/Sources/epoch_config/Configs/CfgEpochClient.hpp +++ b/Sources/epoch_config/Configs/CfgEpochClient.hpp @@ -284,7 +284,7 @@ class CfgEpochClient Killed = "_this call EPOCH_fnc_playerDeath;_this call Epoch_custom_EH_Killed"; HandleRating = "0"; HandleScore = ""; - HandleDamage = "_this call EPOCH_HandleDamage;_this call EPOCH_custom_EH_HandleDamage"; + HandleDamage = "_this call EPOCH_HandleDamage"; HandleHeal = ""; Dammaged = ""; Hit = "_this call EPOCH_custom_EH_Hit";