TopDefenders: Add a loop that compares deaths.
So it only modifies the deaths when ever thats needed, the csgo scoreboard seems to flip the fuck out otherwise.
This commit is contained in:
parent
eb16062d6a
commit
ffb59ecca3
@ -299,6 +299,7 @@ public int SortDefendersList(int[] elem1, int[] elem2, const int[][] array, Hand
|
|||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
public Action UpdateScoreboard(Handle timer)
|
public Action UpdateScoreboard(Handle timer)
|
||||||
{
|
{
|
||||||
|
int iDeathsList[MAXPLAYERS+1];
|
||||||
int iSortedList[MAXPLAYERS+1][2];
|
int iSortedList[MAXPLAYERS+1][2];
|
||||||
int iSortedCount;
|
int iSortedCount;
|
||||||
|
|
||||||
@ -307,7 +308,7 @@ public Action UpdateScoreboard(Handle timer)
|
|||||||
if (!IsClientInGame(client))
|
if (!IsClientInGame(client))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
SetEntProp(client, Prop_Data, "m_iDeaths", 0);
|
iDeathsList[client] = 0;
|
||||||
|
|
||||||
if (!g_iPlayerDamage[client])
|
if (!g_iPlayerDamage[client])
|
||||||
continue;
|
continue;
|
||||||
@ -321,7 +322,18 @@ public Action UpdateScoreboard(Handle timer)
|
|||||||
|
|
||||||
for (int rank = 0; rank < iSortedCount; rank++)
|
for (int rank = 0; rank < iSortedCount; rank++)
|
||||||
{
|
{
|
||||||
SetEntProp(iSortedList[rank][0], Prop_Data, "m_iDeaths", rank + 1);
|
iDeathsList[iSortedList[rank][0]] = rank + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int client = 1; client <= MaxClients; client++)
|
||||||
|
{
|
||||||
|
if (!IsClientInGame(client))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (GetEntProp(client, Prop_Data, "m_iDeaths") != iDeathsList[client])
|
||||||
|
{
|
||||||
|
SetEntProp(client, Prop_Data, "m_iDeaths", iDeathsList[client]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user