Skip to content

Commit 1bac1df

Browse files
authored
fix_engine debug enable fix (#900)
* Update fix_engine.sp fix compiling errors when running with debug 1 updated to new sm1.12 syntax * Update fix_engine.sp updated plugin version
1 parent f39b426 commit 1bac1df

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

addons/sourcemod/scripting/fix_engine.sp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#define PLUGIN_VERSION "1.2"
1+
#define PLUGIN_VERSION "1.3"
22

33
#pragma semicolon 1
44
#pragma newdecls required
@@ -74,6 +74,10 @@ public void OnPluginStart()
7474
#endif
7575
}
7676

77+
#if debug
78+
static Handle g_hDebugTimer[MAXPLAYERS+1];
79+
#endif
80+
7781
public void OnMapEnd()
7882
{
7983
for (int i = 0; i <= MAXPLAYERS; i++)
@@ -500,7 +504,7 @@ void EF_ToogleEvents(bool bHook)
500504
HookEvent("heal_success", EF_ev_HealSuccess);
501505
HookEvent("revive_success", EF_ev_HealSuccess);
502506
HookEvent("player_incapacitated", EF_ev_HealSuccess);
503-
507+
504508
bIsHooked = true;
505509
}
506510
else if (bIsHooked && !bHook){
@@ -511,7 +515,7 @@ void EF_ToogleEvents(bool bHook)
511515
UnhookEvent("heal_success", EF_ev_HealSuccess);
512516
UnhookEvent("revive_success", EF_ev_HealSuccess);
513517
UnhookEvent("player_incapacitated", EF_ev_HealSuccess);
514-
518+
515519
bIsHooked = false;
516520
}
517521
}
@@ -527,7 +531,7 @@ bool IsValidClient(int client)
527531
+==========================================+
528532
*/
529533
#if debug
530-
static bool g_bDebugEnabled[MAXPLAYERS+1], Handle g_hDebugTimer[MAXPLAYERS+1];
534+
static bool g_bDebugEnabled[MAXPLAYERS+1];
531535

532536
Action CmdDebug(int client, int args)
533537
{
@@ -549,6 +553,7 @@ Action CmdDebug(int client, int args)
549553
Action EF_t_LoadDebug(Handle timer, int client)
550554
{
551555
g_hDebugTimer[client] = CreateTimer(0.1, EF_t_DebugMe, client, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
556+
return Plugin_Handled;
552557
}
553558

554559
Action EF_t_DebugMe(Handle timer, int client)
@@ -580,6 +585,8 @@ Action EF_t_DebugMe(Handle timer, int client)
580585
}
581586
else
582587
DisableDebug(client);
588+
589+
return Plugin_Continue;
583590
}
584591

585592
void DisableDebug(int client)

0 commit comments

Comments
 (0)