Skip to content

Commit

Permalink
Update MatchUtil.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
SmileYzn authored Nov 29, 2024
1 parent 0752d89 commit f839166
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions MatchBot/MatchUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,19 +382,19 @@ CBasePlayer* CMatchUtil::GetPlayerByUserId(int UserIndex)

void CMatchUtil::ServerCommand(const char* Format, ...)
{
char cmd[255] = { 0 };
static char szCmd[255] = { 0 };

va_list argptr;
va_list ArgPtr;

va_start(argptr, Format);
va_start(ArgPtr, Format);

vsnprintf(cmd, sizeof(cmd), Format, argptr);
vsnprintf(szCmd, sizeof(szCmd), Format, ArgPtr);

va_end(argptr);
va_end(ArgPtr);

Q_strncat(cmd, "\n", 1);
strcat(szCmd, "\n");

g_engfuncs.pfnServerCommand(cmd);
g_engfuncs.pfnServerCommand(szCmd);
}

unsigned short CMatchUtil::FixedUnsigned16(float value, float scale)
Expand Down Expand Up @@ -513,7 +513,7 @@ const char* CMatchUtil::FormatString(const char* Format, ...)
{
va_list argList;

static char VarArgs[512];
static char VarArgs[256];

va_start(argList, Format);

Expand Down Expand Up @@ -862,4 +862,4 @@ const char* CMatchUtil::GetPlayerAuthId(edict_t* pEntity)

// Return null
return nullptr;
}
}

0 comments on commit f839166

Please sign in to comment.