Skip to content
Merged

Fixes #297

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion codemp/cgame/cg_xcvar.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ XCVAR_DEF( cg_strafeTrailGhost, "1", NULL, CVAR_ARCHIVE )
XCVAR_DEF( cg_strafeTrailPlums, "0", NULL, CVAR_ARCHIVE )
XCVAR_DEF( cg_spotIconPlums, "0", NULL, CVAR_ARCHIVE )

XCVAR_DEF( cg_drainFX, "1", NULL, CVAR_NONE )
XCVAR_DEF( cg_drainFX, "2", NULL, CVAR_NONE )
//Make maxpackets userinfo maybe idk

#if 1
Expand Down
10 changes: 8 additions & 2 deletions codemp/client/cl_cgame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,16 @@ static void CL_UpdateDiscordServerInfo(const char *info)

static void CL_ParsePlayerInfo(int start, int end)
{
#if defined(DISCORD) && !defined(_DEBUG)
int clientCount = 0, botCount = 0, redTeam = 0, blueTeam = 0, specTeam = 0;
int clientCount = 0;
int i = start;
#if defined(DISCORD) && !defined(_DEBUG)
int botCount = 0, redTeam = 0, blueTeam = 0, specTeam = 0;
#endif

while (i < end)
{
char *s = cl.gameState.stringData + cl.gameState.stringOffsets[i];
#if defined(DISCORD) && !defined(_DEBUG)
int team = atoi(Info_ValueForKey(s, "t"));
char *bot = Info_ValueForKey(s, "skill");

Expand All @@ -258,6 +261,7 @@ static void CL_ParsePlayerInfo(int start, int end)
{
botCount++;
}
#endif

if (s && s[0])
{
Expand All @@ -266,7 +270,9 @@ static void CL_ParsePlayerInfo(int start, int end)

i++;
}
gCLTotalClientNum = clientCount;

#if defined(DISCORD) && !defined(_DEBUG)
cl.discord.playerCount = clientCount;
cl.discord.redTeam = redTeam;
cl.discord.blueTeam = blueTeam;
Expand Down
2 changes: 1 addition & 1 deletion codemp/game/g_svcmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ void Svcmd_ToggleTweakWeapons_f( void ) {
else {
char arg[8] = { 0 };
int index;
const uint32_t mask = (1 << MAX_WEAPON_TWEAKS); //overflow?
const uint32_t mask = (1 << MAX_WEAPON_TWEAKS) - 1; //overflow?

trap->Argv( 1, arg, sizeof(arg) );
index = atoi( arg );
Expand Down
13 changes: 7 additions & 6 deletions codemp/game/g_syscalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ static QINLINE void EndHack(int entityNum) { //Should be inline?
int i;
for (i = 0; i < level.num_entities; i++) {
if (i != entityNum && i != level.clients[entityNum].ps.duelIndex) {
if (g_entities[i].inuse &&
((g_entities[i].s.eType == ET_PLAYER || g_entities[i].s.eType == ET_NPC) ||
if (g_entities[i].inuse &&
((g_entities[i].s.eType == ET_PLAYER || g_entities[i].s.eType == ET_NPC) ||
(((dueltypes[level.clients[entityNum].ps.clientNum] <= 1) && (g_entities[i].s.eType == ET_GENERAL)) && (!Q_stricmp(g_entities[i].classname, "laserTrap") || !Q_stricmp(g_entities[i].classname, "detpack"))))) {
g_entities[i].r.ownerNum = saved[i];
}
Expand All @@ -226,10 +226,11 @@ static QINLINE void EndHack(int entityNum) { //Should be inline?
int i;
for (i = 0; i < level.num_entities; i++) {
if (i != entityNum) {
if ((g_entities[i].inuse && (g_entities[i].s.eType == ET_PLAYER)) ||
(g_entities[i].inuse && (g_entities[i].s.eType == ET_NPC)) ||
((g_entities[i].s.eType == ET_MOVER) && (!Q_stricmp(g_entities[i].classname, "func_door") || !Q_stricmp(g_entities[i].classname, "func_plat"))) ||
((g_entities[i].s.eType == ET_GENERAL) && (!Q_stricmp(g_entities[i].classname, "laserTrap") || !Q_stricmp(g_entities[i].classname, "detpack"))))
if (g_entities[i].inuse &&
((g_entities[i].s.eType == ET_PLAYER) ||
(g_entities[i].s.eType == ET_NPC) ||
((g_entities[i].s.eType == ET_MOVER) && (!Q_stricmp(g_entities[i].classname, "func_door") || !Q_stricmp(g_entities[i].classname, "func_plat"))) ||
((g_entities[i].s.eType == ET_GENERAL) && (!Q_stricmp(g_entities[i].classname, "laserTrap") || !Q_stricmp(g_entities[i].classname, "detpack")))))
{
g_entities[i].r.ownerNum = saved[i];
}
Expand Down
Loading