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 <[email protected]>
This commit is contained in:
co-authored by
Nicholas Hastings
parent
af4bb473e7
commit
5d28ea6162
@@ -44,18 +44,16 @@ void CreateBeacon(int client)
|
||||
void KillBeacon(int client)
|
||||
{
|
||||
g_BeaconSerial[client] = 0;
|
||||
|
||||
if (IsClientInGame(client))
|
||||
{
|
||||
SetEntityRenderColor(client, 255, 255, 255, 255);
|
||||
}
|
||||
}
|
||||
|
||||
void KillAllBeacons()
|
||||
{
|
||||
for (int i = 1; i <= MaxClients; i++)
|
||||
{
|
||||
KillBeacon(i);
|
||||
if (g_BeaconSerial[i] != 0)
|
||||
{
|
||||
KillBeacon(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -48,6 +48,11 @@ void CreateFireBomb(int client)
|
||||
|
||||
void KillFireBomb(int client)
|
||||
{
|
||||
if (g_FireBombSerial[client] == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
g_FireBombSerial[client] = 0;
|
||||
|
||||
if (IsClientInGame(client))
|
||||
@@ -72,7 +77,7 @@ void PerformBurn(int client, int target, float seconds)
|
||||
|
||||
void PerformFireBomb(int client, int target)
|
||||
{
|
||||
if (g_FireBombSerial[client] == 0)
|
||||
if (g_FireBombSerial[target] == 0)
|
||||
{
|
||||
CreateFireBomb(target);
|
||||
LogAction(client, target, "\"%L\" set a FireBomb on \"%L\"", client, target);
|
||||
@@ -80,7 +85,6 @@ void PerformFireBomb(int client, int target)
|
||||
else
|
||||
{
|
||||
KillFireBomb(target);
|
||||
SetEntityRenderColor(client, 255, 255, 255, 255);
|
||||
LogAction(client, target, "\"%L\" removed a FireBomb on \"%L\"", client, target);
|
||||
}
|
||||
}
|
||||
@@ -173,7 +177,6 @@ public Action Timer_FireBomb(Handle timer, any value)
|
||||
|
||||
IgniteEntity(client, g_Cvar_BurnDuration.FloatValue);
|
||||
KillFireBomb(client);
|
||||
SetEntityRenderColor(client, 255, 255, 255, 255);
|
||||
|
||||
if (g_Cvar_FireBombMode.IntValue > 0)
|
||||
{
|
||||
|
||||
@@ -47,6 +47,11 @@ void CreateTimeBomb(int client)
|
||||
|
||||
void KillTimeBomb(int client)
|
||||
{
|
||||
if (g_TimeBombSerial[client] == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
g_TimeBombSerial[client] = 0;
|
||||
|
||||
if (IsClientInGame(client))
|
||||
@@ -73,7 +78,6 @@ void PerformTimeBomb(int client, int target)
|
||||
else
|
||||
{
|
||||
KillTimeBomb(target);
|
||||
SetEntityRenderColor(client, 255, 255, 255, 255);
|
||||
LogAction(client, target, "\"%L\" removed a TimeBomb on \"%L\"", client, target);
|
||||
}
|
||||
}
|
||||
@@ -149,7 +153,6 @@ public Action Timer_TimeBomb(Handle timer, any value)
|
||||
|
||||
ForcePlayerSuicide(client);
|
||||
KillTimeBomb(client);
|
||||
SetEntityRenderColor(client, 255, 255, 255, 255);
|
||||
|
||||
if (g_Cvar_TimeBombMode.IntValue > 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user