From 227f3a6c05ef8993b2b90a73a238dcf21f31645a Mon Sep 17 00:00:00 2001 From: zaCade Date: Wed, 22 May 2019 19:23:55 +0200 Subject: [PATCH] Update extension.cpp --- extension.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/extension.cpp b/extension.cpp index 1521c2b..2a78ab6 100644 --- a/extension.cpp +++ b/extension.cpp @@ -142,14 +142,14 @@ DETOUR_DECL_STATIC6(Detour_SendTo, int, int, s, char *, buf, int, len, int, flag { char PlayerReply[1024 * 6]; bf_write PlayerReplyPacket(PlayerReply, sizeof(PlayerReply)); - + PlayerReplyPacket.Reset(); // Build up the packet as a bitbuffer so we can use the nice helper functions to do the work for us PlayerReplyPacket.WriteLong(-1); // FF FF FF FF PlayerReplyPacket.WriteByte(68); // 44 int iPlayers = 0; - + PlayerInfo PlayerList[SM_MAXPLAYERS]; for (int index = 0; index <= SM_MAXPLAYERS; index++) @@ -158,7 +158,7 @@ DETOUR_DECL_STATIC6(Detour_SendTo, int, int, s, char *, buf, int, len, int, flag if (pPlayer != NULL && pPlayer->IsConnected() && pPlayer->IsInGame() && !pPlayer->IsSourceTV()) { - memcpy(PlayerList[iPlayers].Name, pPlayer->GetName(), len); + memcpy(PlayerList[iPlayers].Name, pPlayer->GetName(), 32); IPlayerInfo *pInfo = pPlayer->GetPlayerInfo(); @@ -177,9 +177,9 @@ DETOUR_DECL_STATIC6(Detour_SendTo, int, int, s, char *, buf, int, len, int, flag iPlayers++; } } - + PlayerReplyPacket.WriteByte(iPlayers); // Number of players - + for (int index = 0; index < iPlayers; index++) { PlayerReplyPacket.WriteByte(index);