vec3_t origin, entmins, entmaxs;
matrix4x4_t entmatrix, entinversematrix;
- if(gamemode == GAME_NEXUIZ || gamemode == GAME_XONOTIC)
+ if(IS_OLDNEXUIZ_DERIVED(gamemode))
{
// don't hit network players, if we are a nonsolid player
if(cl.scores[cl.playerentity-1].frags == -666 || cl.scores[cl.playerentity-1].frags == -616)
if (!cl.scores[i-1].name[0])
continue;
- if(gamemode == GAME_NEXUIZ || gamemode == GAME_XONOTIC)
+ if(IS_OLDNEXUIZ_DERIVED(gamemode))
{
// don't hit spectators or nonsolid players
if(cl.scores[i-1].frags == -666 || cl.scores[i-1].frags == -616)
vec3_t origin, entmins, entmaxs;
matrix4x4_t entmatrix, entinversematrix;
- if(gamemode == GAME_NEXUIZ || gamemode == GAME_XONOTIC)
+ if(IS_OLDNEXUIZ_DERIVED(gamemode))
{
// don't hit network players, if we are a nonsolid player
if(cl.scores[cl.playerentity-1].frags == -666 || cl.scores[cl.playerentity-1].frags == -616)
if (!cl.scores[i-1].name[0])
continue;
- if(gamemode == GAME_NEXUIZ || gamemode == GAME_XONOTIC)
+ if(IS_OLDNEXUIZ_DERIVED(gamemode))
{
// don't hit spectators or nonsolid players
if(cl.scores[i-1].frags == -666 || cl.scores[i-1].frags == -616)
vec3_t origin, entmins, entmaxs;
matrix4x4_t entmatrix, entinversematrix;
- if(gamemode == GAME_NEXUIZ || gamemode == GAME_XONOTIC)
+ if(IS_OLDNEXUIZ_DERIVED(gamemode))
{
// don't hit network players, if we are a nonsolid player
if(cl.scores[cl.playerentity-1].frags == -666 || cl.scores[cl.playerentity-1].frags == -616)
if (!cl.scores[i-1].name[0])
continue;
- if(gamemode == GAME_NEXUIZ || gamemode == GAME_XONOTIC)
+ if(IS_OLDNEXUIZ_DERIVED(gamemode))
{
// don't hit spectators or nonsolid players
if(cl.scores[i-1].frags == -666 || cl.scores[i-1].frags == -616)
s->velocity[2] = 80;
else
{
- if (gamemode == GAME_NEXUIZ || gamemode == GAME_XONOTIC)
+ if (IS_NEXUIZ_DERIVED(gamemode))
s->velocity[2] = 200;
else
s->velocity[2] = 100;
if(!(cl.moveflags & MOVEFLAG_VALID))
{
- if(gamemode == GAME_NEXUIZ)
+ if(gamemode == GAME_NEXUIZ) // Legacy hack to work with old servers of Nexuiz.
cl.moveflags = MOVEFLAG_Q2AIRACCELERATE;
}
cl.entities[i].state_current = defaultstate;
}
- if (gamemode == GAME_NEXUIZ || gamemode == GAME_XONOTIC)
+ if (IS_NEXUIZ_DERIVED(gamemode))
{
VectorSet(cl.playerstandmins, -16, -16, -24);
VectorSet(cl.playerstandmaxs, 16, 16, 45);
{
if (e->render.effects & EF_BRIGHTFIELD)
{
- if (gamemode == GAME_NEXUIZ || gamemode == GAME_XONOTIC)
+ if (IS_NEXUIZ_DERIVED(gamemode))
trailtype = EFFECT_TR_NEXUIZPLASMA;
else
CL_EntityParticles(e);
{
if (e->render.effects & EF_BRIGHTFIELD)
{
- if (gamemode == GAME_NEXUIZ || gamemode == GAME_XONOTIC)
+ if (IS_NEXUIZ_DERIVED(gamemode))
trailtype = EFFECT_TR_NEXUIZPLASMA;
}
if (e->render.effects & EF_DIMLIGHT)
// finished loading sounds
}
- if(gamemode == GAME_NEXUIZ || gamemode == GAME_XONOTIC)
+ if(IS_NEXUIZ_DERIVED(gamemode))
Cvar_SetValueQuick(&cl_serverextension_download, false);
// in Nexuiz/Xonotic, the built in download protocol is kinda broken (misses lots
// of dependencies) anyway, and can mess around with the game directory;
// save to disk only if we don't already have it
// (this is mainly for playing back demos)
existingcrc = FS_CRCFile(cls.qw_downloadname, &existingsize);
- if (existingsize || gamemode == GAME_NEXUIZ || gamemode == GAME_XONOTIC || !strcmp(cls.qw_downloadname, csqc_progname.string))
+ if (existingsize || IS_NEXUIZ_DERIVED(gamemode) || !strcmp(cls.qw_downloadname, csqc_progname.string))
// let csprogs ALWAYS go to dlcache, to prevent "viral csprogs"; also, never put files outside dlcache for Nexuiz/Xonotic
{
if ((int)existingsize != size || existingcrc != crc)
cl.stats[STAT_NAILS] = MSG_ReadByte(&cl_message);
cl.stats[STAT_ROCKETS] = MSG_ReadByte(&cl_message);
cl.stats[STAT_CELLS] = MSG_ReadByte(&cl_message);
- if (gamemode == GAME_HIPNOTIC || gamemode == GAME_ROGUE || gamemode == GAME_QUOTH || gamemode == GAME_NEXUIZ)
+ if (gamemode == GAME_HIPNOTIC || gamemode == GAME_ROGUE || gamemode == GAME_QUOTH || IS_OLDNEXUIZ_DERIVED(gamemode))
cl.stats[STAT_ACTIVEWEAPON] = (1<<MSG_ReadByte(&cl_message));
else
cl.stats[STAT_ACTIVEWEAPON] = MSG_ReadByte(&cl_message);
loadingscreendone = false;
- if(gamemode == GAME_NEXUIZ || gamemode == GAME_XONOTIC)
+ if(IS_NEXUIZ_DERIVED(gamemode))
{
// play a bit with the palette (experimental)
palette_rgb_pantscolormap[15][0] = (unsigned char) (128 + 127 * sin(cl.time / exp(1.0f) + 0.0f*M_PI/3.0f));
{ GAME_TOMESOFMEPHISTOPHELES, GAME_TOMESOFMEPHISTOPHELES, "tomesofmephistopheles", "-tomesofmephistopheles", "Tomes of Mephistopheles", "gamedata", NULL, "tom", "tomesofmephistopheles" }, // COMMANDLINEOPTION: Game: -steelstorm runs the game Steel Storm
{ GAME_STRAPBOMB, GAME_STRAPBOMB, "strapbomb", "-strapbomb", "Strap-on-bomb Car", "id1", NULL, "strap", "strapbomb" }, // COMMANDLINEOPTION: Game: -strapbomb runs the game Strap-on-bomb Car
{ GAME_MOONHELM, GAME_MOONHELM, "moonhelm", "-moonhelm", "MoonHelm", "data", NULL, "mh", "moonhelm" }, // COMMANDLINEOPTION: Game: -moonhelm runs the game MoonHelm
-{ GAME_VORETOURNAMENT, GAME_NORMAL, "voretournament", "-voretournament", "Vore Tournament", "data", NULL, "voretournament","voretournament" }, // COMMANDLINEOPTION: Game: -voretournament runs the multiplayer game Vore Tournament
+{ GAME_VORETOURNAMENT, GAME_VORETOURNAMENT, "voretournament", "-voretournament", "Vore Tournament", "data", NULL, "voretournament", "voretournament" }, // COMMANDLINEOPTION: Game: -voretournament runs the multiplayer game Vore Tournament
};
static void COM_SetGameType(int index);
}
gamemode_t;
+// Master switch for some hacks/changes that eventually should become cvars.
+#define IS_NEXUIZ_DERIVED(g) ((g) == GAME_NEXUIZ || (g) == GAME_XONOTIC || (g) == GAME_VORETOURNAMENT)
+// Pre-csqcmodels era.
+#define IS_OLDNEXUIZ_DERIVED(g) ((g) == GAME_NEXUIZ || (g) == GAME_VORETOURNAMENT)
+
extern gamemode_t gamemode;
extern const char *gamename;
extern const char *gamedirname1;
{
if (con_chatsound.value)
{
- if(gamemode == GAME_NEXUIZ || gamemode == GAME_XONOTIC)
+ if(IS_NEXUIZ_DERIVED(gamemode))
{
if(msg[1] == '\r' && cl.foundtalk2wav)
S_LocalSound ("sound/misc/talk2.wav");
align = con_notifyalign.value;
if(!*con_notifyalign.string) // empty string, evaluated to 0 above
{
- if(gamemode == GAME_NEXUIZ)
+ if(IS_OLDNEXUIZ_DERIVED(gamemode))
align = 0.5;
}
else
{
// default players in some games, singleplayer in most
- if (gamemode != GAME_GOODVSBAD2 && gamemode != GAME_NEXUIZ && gamemode != GAME_XONOTIC && gamemode != GAME_BATTLEMECH)
+ if (gamemode != GAME_GOODVSBAD2 && !IS_NEXUIZ_DERIVED(gamemode) && gamemode != GAME_BATTLEMECH)
svs.maxclients = 1;
}
}
*p = 0;
}
- if ((gamemode == GAME_NEXUIZ || gamemode == GAME_XONOTIC) && (teamplay.integer > 0))
+ if (IS_NEXUIZ_DERIVED(gamemode) && (teamplay.integer > 0))
{
if(cl->frags == -666) // spectator
strlcpy(teambuf, " 0", sizeof(teambuf));
if (gamemode == GAME_DELUXEQUAKE || gamemode == GAME_BLOODOMNICIDE)
{
}
- else if (gamemode == GAME_NEXUIZ)
+ else if (IS_OLDNEXUIZ_DERIVED(gamemode))
{
for (i = 0;i < 10;i++)
sb_nums[0][i] = Draw_CachePic_Flags (va(vabuf, sizeof(vabuf), "gfx/num_%i",i), CACHEPICFLAG_QUIET);
static int Sbar_IsTeammatch(void)
{
// currently only nexuiz uses the team score board
- return ((gamemode == GAME_NEXUIZ)
+ return (IS_OLDNEXUIZ_DERIVED(gamemode)
&& (teamplay.integer > 0));
}
int minutes, seconds, tens, units;
int l;
- if (gamemode != GAME_NEXUIZ) {
+ if (IS_OLDNEXUIZ_DERIVED(gamemode)) {
dpsnprintf (str, sizeof(str), "Monsters:%3i /%3i", cl.stats[STAT_MONSTERS], cl.stats[STAT_TOTALMONSTERS]);
Sbar_DrawString (8, 4, str);
Sbar_DrawString (184, 4, str);
// draw level name
- if (gamemode == GAME_NEXUIZ) {
+ if (IS_OLDNEXUIZ_DERIVED(gamemode)) {
l = (int) strlen (cl.worldname);
Sbar_DrawString (232 - l*4, 12, cl.worldname);
} else {
{
default:
case 1:
- if(gamemode == GAME_NEXUIZ || gamemode == GAME_XONOTIC)
+ if(IS_NEXUIZ_DERIVED(gamemode))
*unit = "in/s";
else
*unit = "qu/s";
case 2:
*unit = "m/s";
*conversion_factor = 0.0254;
- if(gamemode != GAME_NEXUIZ && gamemode != GAME_XONOTIC) *conversion_factor *= 1.5;
+ if(!IS_NEXUIZ_DERIVED(gamemode))
+ *conversion_factor *= 1.5;
// 1qu=1.5in is for non-Nexuiz/Xonotic only - Nexuiz/Xonotic players are overly large, but 1qu=1in fixes that
break;
case 3:
*unit = "km/h";
*conversion_factor = 0.0254 * 3.6;
- if(gamemode != GAME_NEXUIZ && gamemode != GAME_XONOTIC) *conversion_factor *= 1.5;
+ if(!IS_NEXUIZ_DERIVED(gamemode))
+ *conversion_factor *= 1.5;
break;
case 4:
*unit = "mph";
*conversion_factor = 0.0254 * 3.6 * 0.6213711922;
- if(gamemode != GAME_NEXUIZ && gamemode != GAME_XONOTIC) *conversion_factor *= 1.5;
+ if(!IS_NEXUIZ_DERIVED(gamemode))
+ *conversion_factor *= 1.5;
break;
case 5:
*unit = "knots";
*conversion_factor = 0.0254 * 1.943844492; // 1 m/s = 1.943844492 knots, because 1 knot = 1.852 km/h
- if(gamemode != GAME_NEXUIZ && gamemode != GAME_XONOTIC) *conversion_factor *= 1.5;
+ if(!IS_NEXUIZ_DERIVED(gamemode))
+ *conversion_factor *= 1.5;
break;
}
}
Sbar_DrawScoreboard ();
else if (cl.intermission == 1)
{
- if(gamemode == GAME_NEXUIZ) // display full scoreboard (that is, show scores + map name)
+ if(IS_OLDNEXUIZ_DERIVED(gamemode)) // display full scoreboard (that is, show scores + map name)
{
Sbar_DrawScoreboard();
return;
else if (gamemode == GAME_DELUXEQUAKE)
{
}
- else if (gamemode == GAME_NEXUIZ)
+ else if (IS_OLDNEXUIZ_DERIVED(gamemode))
{
if (sb_showscores || (cl.stats[STAT_HEALTH] <= 0 && cl_deathscoreboard.integer))
{
xmin = (int) (vid_conwidth.integer - (16 + 25) * 8 * FONT_SBAR->maxwidth) / 2; // 16 characters until name, then we assume 25 character names (they can be longer but usually aren't)
xmax = vid_conwidth.integer - xmin;
- if(gamemode == GAME_NEXUIZ)
+ if(IS_OLDNEXUIZ_DERIVED(gamemode))
DrawQ_Pic (xmin - 8, ymin - 8, 0, xmax-xmin+1 + 2*8, ymax-ymin+1 + 2*8, 0, 0, 0, sbar_alpha_bg.value, 0);
DrawQ_Pic ((vid_conwidth.integer - sb_ranking->width)/2, 8, sb_ranking, 0, 0, 1, 1, 1, 1 * sbar_alpha_fg.value, 0);
if(cl.stats[STAT_TOTALSECRETS])
{
Sbar_DrawNum (160, 104, cl.stats[STAT_SECRETS], 3, 0);
- if (gamemode != GAME_NEXUIZ)
+ if (!IS_OLDNEXUIZ_DERIVED(gamemode))
Sbar_DrawPic (232, 104, sb_slash);
Sbar_DrawNum (240, 104, cl.stats[STAT_TOTALSECRETS], 3, 0);
}
if(cl.stats[STAT_TOTALMONSTERS])
{
Sbar_DrawNum (160, 144, cl.stats[STAT_MONSTERS], 3, 0);
- if (gamemode != GAME_NEXUIZ)
+ if (!IS_OLDNEXUIZ_DERIVED(gamemode))
Sbar_DrawPic (232, 144, sb_slash);
Sbar_DrawNum (240, 144, cl.stats[STAT_TOTALMONSTERS], 3, 0);
}
MSG_WriteByte (msg, stats[STAT_NAILS]);
MSG_WriteByte (msg, stats[STAT_ROCKETS]);
MSG_WriteByte (msg, stats[STAT_CELLS]);
- if (gamemode == GAME_HIPNOTIC || gamemode == GAME_ROGUE || gamemode == GAME_QUOTH || gamemode == GAME_NEXUIZ)
+ if (gamemode == GAME_HIPNOTIC || gamemode == GAME_ROGUE || gamemode == GAME_QUOTH || IS_OLDNEXUIZ_DERIVED(gamemode))
{
for (i = 0;i < 32;i++)
if (stats[STAT_ACTIVEWEAPON] & (1<<i))
// frags
host_client->frags = (int)PRVM_serveredictfloat(host_client->edict, frags);
- if(gamemode == GAME_NEXUIZ || gamemode == GAME_XONOTIC)
+ if(IS_OLDNEXUIZ_DERIVED(gamemode))
if(!host_client->begun && host_client->netconnection)
host_client->frags = -666;
if (host_client->old_frags != host_client->frags)