From 3565bba208c0c200f156f8cc1bfa055551348822 Mon Sep 17 00:00:00 2001 From: TotallyNotElite <1yourexperiment@protonmail.com> Date: Fri, 22 Mar 2019 10:49:07 +0100 Subject: [PATCH] Autoheal: fix steamid ignoring CanHeal Fixes #712 --- src/hacks/AutoHeal.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/hacks/AutoHeal.cpp b/src/hacks/AutoHeal.cpp index 3c34d317..653e1249 100644 --- a/src/hacks/AutoHeal.cpp +++ b/src/hacks/AutoHeal.cpp @@ -533,7 +533,7 @@ void CreateMove() CachedEntity *target = ENTITY(force_healing_target); if (CE_GOOD(target)) { - if (target->player_info.friendsID != steamid) + if (target->player_info.friendsID != steamid || !CanHeal(force_healing_target)) force_healing_target = 0; else { @@ -543,15 +543,17 @@ void CreateMove() current_user_cmd->buttons |= IN_ATTACK; } } + else + force_healing_target = 0; } else if (steamid) { - for (auto i = 0; i < g_IEngine->GetMaxClients(); i++) + for (int i = 1; i < g_IEngine->GetMaxClients(); i++) { CachedEntity *ent = ENTITY(i); - if (!ent || !ent->player_info.friendsID) + if (CE_BAD(ent) || !ent->player_info.friendsID) continue; - if (ent->player_info.friendsID == steamid) + if (ent->player_info.friendsID == steamid && CanHeal(i)) { force_healing_target = steamid; break;