void Sbar_Init (void)
{
- if(gamemode == GAME_NORMAL) // Workaround so Quake doesn't trample on Xonotic.
- {
- Cmd_AddCommand(CF_CLIENT, "+showscores", Sbar_ShowScores_f, "show scoreboard");
- Cmd_AddCommand(CF_CLIENT, "-showscores", Sbar_DontShowScores_f, "hide scoreboard");
- }
+ Cmd_AddCommand(CF_CLIENT, "+showscores", Sbar_ShowScores_f, "show scoreboard");
+ Cmd_AddCommand(CF_CLIENT, "-showscores", Sbar_DontShowScores_f, "hide scoreboard");
Cvar_RegisterVariable(&cl_showfps);
Cvar_RegisterVariable(&cl_showsound);
Cvar_RegisterVariable(&cl_showblur);
teamname = "Total Team Score";
break;
}
- strlcpy(teams[teamlines-1].name, teamname, sizeof(teams[teamlines-1].name));
+ dp_strlcpy(teams[teamlines-1].name, teamname, sizeof(teams[teamlines-1].name));
teams[teamlines-1].frags = 0;
teams[teamlines-1].colors = color + 16 * color;
Sbar_DrawString(8+22*8, 4, va(vabuf, sizeof(vabuf), "Secrets:%3i", cl.stats[STAT_SECRETS]));
// format is like this: e1m1:The Sligpate Complex
- dpsnprintf(str, sizeof(str), "%s:%s", cl.worldbasename, cl.worldmessage);
+ dpsnprintf(str, sizeof(str), "%s:%.39s", cl.worldbasename, cl.worldmessage);
// if there's a newline character, terminate the string there
if (strchr(str, '\n'))
// items
for (i=0 ; i<6 ; i++)
- if (cl.stats[STAT_ITEMS] & (1<<(17+i)))
+ if (cl.stats[STAT_ITEMS] & (1u<<(17+i)))
{
//MED 01/04/97 changed keys
if (!(gamemode == GAME_HIPNOTIC || gamemode == GAME_QUOTH) || (i>1))
if (gamemode == GAME_HIPNOTIC || gamemode == GAME_QUOTH)
{
for (i=0 ; i<2 ; i++)
- if (cl.stats[STAT_ITEMS] & (1<<(24+i)))
+ if (cl.stats[STAT_ITEMS] & (1u<<(24+i)))
Sbar_DrawPic (288 + i*16, -16, hsb_items[i]);
}
{
// new rogue items
for (i=0 ; i<2 ; i++)
- if (cl.stats[STAT_ITEMS] & (1<<(29+i)))
+ if (cl.stats[STAT_ITEMS] & (1u<<(29+i)))
Sbar_DrawPic (288 + i*16, -16, rsb_items[i]);
}
else
{
// sigils
for (i=0 ; i<4 ; i++)
- if (cl.stats[STAT_ITEMS] & (1<<(28+i)))
+ if (cl.stats[STAT_ITEMS] & (1u<<(28+i)))
Sbar_DrawPic (320-32 + i*8, -16, sb_sigil[i]);
}
}
}
if (cl_showtime.integer)
{
- strlcpy(timestring, Sys_TimeString(cl_showtime_format.string), sizeof(timestring));
+ dp_strlcpy(timestring, Sys_TimeString(cl_showtime_format.string), sizeof(timestring));
fps_strings++;
}
if (cl_showdate.integer)
{
- strlcpy(datestring, Sys_TimeString(cl_showdate_format.string), sizeof(datestring));
+ dp_strlcpy(datestring, Sys_TimeString(cl_showdate_format.string), sizeof(datestring));
fps_strings++;
}
if (cl_showblur.integer)
svtrace.fraction = 2.0;
cltrace.fraction = 2.0;
// ray hits models (even animated ones) and ignores translucent materials
- if (SVVM_prog != NULL)
+ if (sv.active)
svtrace = SV_TraceLine(org, dest, MOVE_HITMODEL, NULL, SUPERCONTENTS_SOLID, 0, MATERIALFLAGMASK_TRANSLUCENT, collision_extendmovelength.value);
cltrace = CL_TraceLine(org, dest, MOVE_HITMODEL, NULL, SUPERCONTENTS_SOLID, 0, MATERIALFLAGMASK_TRANSLUCENT, collision_extendmovelength.value, true, false, &hitnetentity, true, true);
if (cltrace.hittexture)
- strlcpy(texstring, cltrace.hittexture->name, sizeof(texstring));
+ dp_strlcpy(texstring, cltrace.hittexture->name, sizeof(texstring));
else
- strlcpy(texstring, "(no texture hit)", sizeof(texstring));
+ dp_strlcpy(texstring, "(no texture hit)", sizeof(texstring));
fps_strings++;
if (svtrace.fraction < cltrace.fraction)
{
dpsnprintf(entstring, sizeof(entstring), "server entity %i", (int)PRVM_EDICT_TO_PROG(svtrace.ent));
}
else
- strlcpy(entstring, "(no entity hit)", sizeof(entstring));
+ dp_strlcpy(entstring, "(no entity hit)", sizeof(entstring));
}
else
{
- if (CLVM_prog != NULL && cltrace.ent != NULL)
+ if (cltrace.ent != NULL)
{
prvm_prog_t *prog = CLVM_prog;
dpsnprintf(entstring, sizeof(entstring), "client entity %i", (int)PRVM_EDICT_TO_PROG(cltrace.ent));
else if (hitnetentity > 0)
dpsnprintf(entstring, sizeof(entstring), "network entity %i", hitnetentity);
else if (hitnetentity == 0)
- strlcpy(entstring, "world entity", sizeof(entstring));
+ dp_strlcpy(entstring, "world entity", sizeof(entstring));
else
- strlcpy(entstring, "(no entity hit)", sizeof(entstring));
+ dp_strlcpy(entstring, "(no entity hit)", sizeof(entstring));
}
fps_strings++;
}