GlowColors: Fix last commit

This commit is contained in:
BotoX 2017-05-03 01:02:36 +02:00
parent 8b032c5c9e
commit 34e17ed6d2

View File

@ -291,8 +291,8 @@ public MRESReturn AcceptInput(int pThis, Handle hReturn, Handle hParams)
} }
else if(StrEqual(sValue[aArgs[0]], "rendermode", false)) else if(StrEqual(sValue[aArgs[0]], "rendermode", false))
{ {
int renderMode = StringToInt(sValue[aArgs[1]]) & 0xFF; RenderMode renderMode = view_as<RenderMode>(StringToInt(sValue[aArgs[1]]) & 0xFF);
if(renderMode == 0) if(renderMode == RENDER_NORMAL)
{ {
ApplyGlowColor(client); ApplyGlowColor(client);
return MRES_Ignored; return MRES_Ignored;
@ -427,7 +427,7 @@ public void Event_ApplyGlowColor(Event event, const char[] name, bool dontBroadc
if(!client) if(!client)
return; return;
RequestFrame(view_as<RequestFrameCallback>(ApplyGlowColor), client); CreateTimer(0.1, Timer_ApplyGlowcolor, client, TIMER_FLAG_NO_MAPCHANGE);
} }
public void ZR_OnClientInfected(int client, int attacker, bool motherInfect, bool respawnOverride, bool respawn) public void ZR_OnClientInfected(int client, int attacker, bool motherInfect, bool respawnOverride, bool respawn)
@ -440,6 +440,12 @@ public void ZR_OnClientHumanPost(int client, bool respawn, bool protect)
ApplyGlowColor(client); ApplyGlowColor(client);
} }
Action Timer_ApplyGlowcolor(Handle timer, int client)
{
ApplyGlowColor(client);
return Plugin_Stop;
}
bool ApplyGlowColor(int client) bool ApplyGlowColor(int client)
{ {
if(!IsClientInGame(client)) if(!IsClientInGame(client))