TopDefenders: Remove Forward due to limitations.

Seems we cant push all the data because of limitations causing a runtime
error. Forward wasn't used anyway.
This commit is contained in:
zaCade 2018-09-23 21:12:44 +02:00
parent 60ee341b85
commit d2f097bed8

View File

@ -35,8 +35,8 @@ int g_iCrownEntity = -1;
int g_iDialogLevel = 100000;
int g_iPlayerWinner[3];
int g_iPlayerHits[MAXPLAYERS+1];
int g_iPlayerDamage[MAXPLAYERS+1];
int g_iPlayerDamageHits[MAXPLAYERS+1];
int g_iPlayerDamageFrom1K[MAXPLAYERS + 1];
//----------------------------------------------------------------------------------------------------
@ -278,8 +278,9 @@ public void OnClientCookiesCached(int client)
//----------------------------------------------------------------------------------------------------
public void OnClientDisconnect(int client)
{
g_iPlayerHits[client] = 0;
g_iPlayerDamage[client] = 0;
g_iPlayerDamageHits[client] = 0;
g_iPlayerDamageFrom1K[client] = 0;
g_bHideCrown[client] = false;
g_bHideDialog[client] = false;
@ -373,8 +374,8 @@ public void OnRoundStart(Event hEvent, const char[] sEvent, bool bDontBroadcast)
for (int client = 1; client <= MaxClients; client++)
{
g_iPlayerHits[client] = 0;
g_iPlayerDamage[client] = 0;
g_iPlayerDamageHits[client] = 0;
g_iPlayerDamageFrom1K[client] = 0;
}
}
@ -396,7 +397,7 @@ public void OnRoundEnding(Event hEvent, const char[] sEvent, bool bDontBroadcast
iSortedList[iSortedCount][0] = client;
iSortedList[iSortedCount][1] = g_iPlayerDamage[client];
iSortedList[iSortedCount][2] = g_iPlayerHits[client];
iSortedList[iSortedCount][2] = g_iPlayerDamageHits[client];
iSortedCount++;
}
@ -409,17 +410,6 @@ public void OnRoundEnding(Event hEvent, const char[] sEvent, bool bDontBroadcast
if (iSortedCount)
{
int iPlayers[MAXPLAYERS+1];
int iDamage[MAXPLAYERS+1];
int iHits[MAXPLAYERS+1];
for (int rank = 0; rank < iSortedCount; rank++)
{
iPlayers[rank] = iSortedList[rank][0];
iDamage[rank] = iSortedList[rank][1];
iHits[rank] = iSortedList[rank][2];
}
char sBuffer[512];
Format(sBuffer, sizeof(sBuffer), "TOP DEFENDERS:");
Format(sBuffer, sizeof(sBuffer), "%s\n*************************", sBuffer);
@ -505,8 +495,6 @@ public void OnRoundEnding(Event hEvent, const char[] sEvent, bool bDontBroadcast
}
else
PrintToChatAll(sBuffer);
TopDefenders_OnRoundEnd(iPlayers, iDamage, iHits);
}
}
@ -526,8 +514,8 @@ public void OnClientHurt(Event hEvent, const char[] sEvent, bool bDontBroadcast)
int iDamage = hEvent.GetInt("dmg_health");
g_iPlayerHits[client] += 1;
g_iPlayerDamage[client] += iDamage;
g_iPlayerDamageHits[client] += 1;
g_iPlayerDamageFrom1K[client] += iDamage;
if (g_iPlayerDamageFrom1K[client] >= 1000)
@ -668,18 +656,6 @@ public Action ZR_OnClientInfect(&client, &attacker, &bool:motherInfect, &bool:re
return Plugin_Continue;
}
//----------------------------------------------------------------------------------------------------
// Purpose:
//----------------------------------------------------------------------------------------------------
bool TopDefenders_OnRoundEnd(int iPlayers[MAXPLAYERS+1], int iDamage[MAXPLAYERS+1], int iHits[MAXPLAYERS+1])
{
Call_StartForward(g_hForward_OnRoundEndingWithTopDefenders);
Call_PushArray(iPlayers, sizeof(iPlayers));
Call_PushArray(iDamage, sizeof(iDamage));
Call_PushArray(iHits, sizeof(iHits));
Call_Finish();
}
//----------------------------------------------------------------------------------------------------
// Purpose:
//----------------------------------------------------------------------------------------------------
@ -715,7 +691,7 @@ public int Native_GetClientHits(Handle hPlugin, int numParams)
return ThrowNativeError(SP_ERROR_NATIVE, "Client %d is not in game", client);
}
return g_iPlayerHits[client];
return g_iPlayerDamageHits[client];
}
//----------------------------------------------------------------------------------------------------