Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed previous askers healing #386

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions addons/sourcemod/scripting/MyJailbreak/Modules/Request/heal.sp
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ ConVar gc_iHealColorBlue;
ConVar gc_sCustomCommandHeal;
ConVar gc_sAdminFlagHeal;

// Booleans
bool g_bHealed[MAXPLAYERS+1];

// Integers
int g_iHealCounter[MAXPLAYERS+1];

Expand Down Expand Up @@ -126,7 +123,6 @@ public Action Command_Heal(int client, int args)
{
g_bIsRequest = true;
g_hTimerRequest = CreateTimer (gc_fHealTime.FloatValue, Timer_IsRequest);
g_bHealed[client] = true;
g_iHealCounter[client]++;
CPrintToChatAll("%s %t", g_sPrefix, "request_heal", client);
SetEntityRenderColor(client, gc_iHealColorRed.IntValue, gc_iHealColorGreen.IntValue, gc_iHealColorBlue.IntValue, 255);
Expand Down Expand Up @@ -166,7 +162,6 @@ public void Heal_Event_RoundStart(Event event, char[] name, bool dontBroadcast)
delete g_hTimerHeal[i];

g_iHealCounter[i] = 0;
g_bHealed[i] = false;

if (MyJB_CheckVIPFlags(i, "sm_heal_flag", gc_sAdminFlagHeal, "sm_heal_flag"))
{
Expand Down Expand Up @@ -210,8 +205,6 @@ public void Heal_OnClientPutInServer(int client)
{
g_iHealCounter[client] = -1;
}

g_bHealed[client] = false;
}

public void Heal_OnClientDisconnect(int client)
Expand Down Expand Up @@ -256,7 +249,7 @@ public int HealMenuHandler(Menu menu, MenuAction action, int client, int Positio
if (!IsValidClient(i, false, true))
continue;

if (!g_bHealed[i])
if (g_hTimerHeal[i] == null)
continue;

g_bIsRequest = false;
Expand All @@ -276,7 +269,7 @@ public int HealMenuHandler(Menu menu, MenuAction action, int client, int Positio
if (!IsValidClient(i, false, true))
continue;

if (!g_bHealed[i])
if (g_hTimerHeal[i] == null)
continue;

CPrintToChatAll("%s %t", g_sPrefix, "request_noaccepted", i, client);
Expand Down Expand Up @@ -306,5 +299,4 @@ public Action Timer_ResetColorHeal(Handle timer, int userid)
}

g_hTimerHeal[client] = null;
g_bHealed[client] = false;
}