Skip to content

Commit 5d28ea6

Browse files
RealBerkepsychonic
andauthored
Fix the funcommands plugin resetting all players' color and transparency on round end (#2446)
* Add check for client status before resetting * Get rid of unnecessary color reset on beacon remove * Fix firebomb/timebomb resetting color when effect was not active * Fix firebomb toggling wrong client's active status --------- Co-authored-by: Nicholas Hastings <nshastings@gmail.com>
1 parent af4bb47 commit 5d28ea6

3 files changed

Lines changed: 15 additions & 11 deletions

File tree

plugins/funcommands/beacon.sp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,16 @@ void CreateBeacon(int client)
4444
void KillBeacon(int client)
4545
{
4646
g_BeaconSerial[client] = 0;
47-
48-
if (IsClientInGame(client))
49-
{
50-
SetEntityRenderColor(client, 255, 255, 255, 255);
51-
}
5247
}
5348

5449
void KillAllBeacons()
5550
{
5651
for (int i = 1; i <= MaxClients; i++)
5752
{
58-
KillBeacon(i);
53+
if (g_BeaconSerial[i] != 0)
54+
{
55+
KillBeacon(i);
56+
}
5957
}
6058
}
6159

plugins/funcommands/fire.sp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ void CreateFireBomb(int client)
4848

4949
void KillFireBomb(int client)
5050
{
51+
if (g_FireBombSerial[client] == 0)
52+
{
53+
return;
54+
}
55+
5156
g_FireBombSerial[client] = 0;
5257

5358
if (IsClientInGame(client))
@@ -72,15 +77,14 @@ void PerformBurn(int client, int target, float seconds)
7277

7378
void PerformFireBomb(int client, int target)
7479
{
75-
if (g_FireBombSerial[client] == 0)
80+
if (g_FireBombSerial[target] == 0)
7681
{
7782
CreateFireBomb(target);
7883
LogAction(client, target, "\"%L\" set a FireBomb on \"%L\"", client, target);
7984
}
8085
else
8186
{
8287
KillFireBomb(target);
83-
SetEntityRenderColor(client, 255, 255, 255, 255);
8488
LogAction(client, target, "\"%L\" removed a FireBomb on \"%L\"", client, target);
8589
}
8690
}
@@ -173,7 +177,6 @@ public Action Timer_FireBomb(Handle timer, any value)
173177

174178
IgniteEntity(client, g_Cvar_BurnDuration.FloatValue);
175179
KillFireBomb(client);
176-
SetEntityRenderColor(client, 255, 255, 255, 255);
177180

178181
if (g_Cvar_FireBombMode.IntValue > 0)
179182
{

plugins/funcommands/timebomb.sp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ void CreateTimeBomb(int client)
4747

4848
void KillTimeBomb(int client)
4949
{
50+
if (g_TimeBombSerial[client] == 0)
51+
{
52+
return;
53+
}
54+
5055
g_TimeBombSerial[client] = 0;
5156

5257
if (IsClientInGame(client))
@@ -73,7 +78,6 @@ void PerformTimeBomb(int client, int target)
7378
else
7479
{
7580
KillTimeBomb(target);
76-
SetEntityRenderColor(client, 255, 255, 255, 255);
7781
LogAction(client, target, "\"%L\" removed a TimeBomb on \"%L\"", client, target);
7882
}
7983
}
@@ -149,7 +153,6 @@ public Action Timer_TimeBomb(Handle timer, any value)
149153

150154
ForcePlayerSuicide(client);
151155
KillTimeBomb(client);
152-
SetEntityRenderColor(client, 255, 255, 255, 255);
153156

154157
if (g_Cvar_TimeBombMode.IntValue > 0)
155158
{

0 commit comments

Comments
 (0)