Update extension.cpp
This commit is contained in:
parent
310f5373d3
commit
4980a3c067
@ -100,12 +100,21 @@ DETOUR_DECL_STATIC6(Detour_SendTo, int, int, s, char *, buf, int, len, int, flag
|
||||
// Skip game id
|
||||
NewBuf += 2;
|
||||
|
||||
// Calculate playercount
|
||||
int iPlayers = 0;
|
||||
|
||||
for (int index = 0; index <= SM_MAXPLAYERS; index++)
|
||||
{
|
||||
IGamePlayer *pPlayer = playerhelpers->GetGamePlayer(index);
|
||||
|
||||
if (pPlayer != NULL && pPlayer->IsConnected() && !pPlayer->IsSourceTV())
|
||||
{
|
||||
iPlayers += 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Correct playercount
|
||||
int NumPlayers = playerhelpers->GetNumPlayers();
|
||||
|
||||
NumPlayers -= 1; // Subtract SourceTV
|
||||
|
||||
memset(NewBuf, NumPlayers, 1);
|
||||
memset(NewBuf, iPlayers, 1);
|
||||
|
||||
// Reset Pointer
|
||||
NewBuf = OldBuf;
|
||||
|
Loading…
Reference in New Issue
Block a user