mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-03-10 12:01:43 +00:00
host_cmd.c, menu.c: sanitize whitespace/formatting.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@252 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
4a1e01a976
commit
d5e85a5e6c
2 changed files with 309 additions and 274 deletions
|
@ -225,16 +225,19 @@ void ExtraMaps_Add (char *name)
|
||||||
{
|
{
|
||||||
extralevel_t *level,*cursor,*prev;
|
extralevel_t *level,*cursor,*prev;
|
||||||
|
|
||||||
//ingore duplicate
|
// ignore duplicate
|
||||||
for (level = extralevels; level; level = level->next)
|
for (level = extralevels; level; level = level->next)
|
||||||
|
{
|
||||||
if (!Q_strcmp (name, level->name))
|
if (!Q_strcmp (name, level->name))
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
level = (extralevel_t *) Z_Malloc(sizeof(extralevel_t));
|
level = (extralevel_t *) Z_Malloc(sizeof(extralevel_t));
|
||||||
strcpy (level->name, name);
|
strcpy (level->name, name);
|
||||||
|
|
||||||
//insert each entry in alphabetical order
|
// insert each entry in alphabetical order
|
||||||
if (extralevels == NULL || Q_strcasecmp(level->name, extralevels->name) < 0) //insert at front
|
if (extralevels == NULL ||
|
||||||
|
Q_strcasecmp(level->name, extralevels->name) < 0) //insert at front
|
||||||
{
|
{
|
||||||
level->next = extralevels;
|
level->next = extralevels;
|
||||||
extralevels = level;
|
extralevels = level;
|
||||||
|
@ -264,10 +267,11 @@ void ExtraMaps_Init (void)
|
||||||
pack_t *pak;
|
pack_t *pak;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
//we don't want to list the maps in id1 pakfiles, becuase these are not "add-on" levels
|
// we don't want to list the maps in id1 pakfiles,
|
||||||
|
// because these are not "add-on" levels
|
||||||
sprintf (ignorepakdir, "/%s/", GAMENAME);
|
sprintf (ignorepakdir, "/%s/", GAMENAME);
|
||||||
|
|
||||||
for (search = com_searchpaths ; search ; search = search->next)
|
for (search = com_searchpaths; search; search = search->next)
|
||||||
{
|
{
|
||||||
if (*search->filename) //directory
|
if (*search->filename) //directory
|
||||||
{
|
{
|
||||||
|
@ -286,14 +290,14 @@ void ExtraMaps_Init (void)
|
||||||
}
|
}
|
||||||
else //pakfile
|
else //pakfile
|
||||||
{
|
{
|
||||||
if (!strstr(search->pack->filename, ignorepakdir)) //don't list standard id maps
|
if (!strstr(search->pack->filename, ignorepakdir))
|
||||||
{
|
{ //don't list standard id maps
|
||||||
for (i=0, pak=search->pack; i<pak->numfiles ; i++)
|
for (i = 0, pak = search->pack; i < pak->numfiles; i++)
|
||||||
{
|
{
|
||||||
if (strstr(pak->files[i].name, ".bsp"))
|
if (strstr(pak->files[i].name, ".bsp"))
|
||||||
{
|
{
|
||||||
if (pak->files[i].filelen > 32*1024) // don't list files under 32k (ammo boxes etc)
|
if (pak->files[i].filelen > 32*1024)
|
||||||
{
|
{ // don't list files under 32k (ammo boxes etc)
|
||||||
COM_StripExtension(pak->files[i].name + 5, mapname);
|
COM_StripExtension(pak->files[i].name + 5, mapname);
|
||||||
ExtraMaps_Add (mapname);
|
ExtraMaps_Add (mapname);
|
||||||
}
|
}
|
||||||
|
@ -332,7 +336,7 @@ void Host_Maps_f (void)
|
||||||
int i;
|
int i;
|
||||||
extralevel_t *level;
|
extralevel_t *level;
|
||||||
|
|
||||||
for (level=extralevels, i=0; level; level=level->next, i++)
|
for (level = extralevels, i = 0; level; level = level->next, i++)
|
||||||
Con_SafePrintf (" %s\n", level->name);
|
Con_SafePrintf (" %s\n", level->name);
|
||||||
|
|
||||||
if (i)
|
if (i)
|
||||||
|
@ -359,14 +363,17 @@ void Modlist_Add (char *name)
|
||||||
|
|
||||||
//ingore duplicate
|
//ingore duplicate
|
||||||
for (mod = modlist; mod; mod = mod->next)
|
for (mod = modlist; mod; mod = mod->next)
|
||||||
|
{
|
||||||
if (!Q_strcmp (name, mod->name))
|
if (!Q_strcmp (name, mod->name))
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
mod = (mod_t *) Z_Malloc(sizeof(mod_t));
|
mod = (mod_t *) Z_Malloc(sizeof(mod_t));
|
||||||
strcpy (mod->name, name);
|
strcpy (mod->name, name);
|
||||||
|
|
||||||
//insert each entry in alphabetical order
|
//insert each entry in alphabetical order
|
||||||
if (modlist == NULL || Q_strcasecmp(mod->name, modlist->name) < 0) //insert at front
|
if (modlist == NULL ||
|
||||||
|
Q_strcasecmp(mod->name, modlist->name) < 0) //insert at front
|
||||||
{
|
{
|
||||||
mod->next = modlist;
|
mod->next = modlist;
|
||||||
modlist = mod;
|
modlist = mod;
|
||||||
|
@ -513,7 +520,7 @@ void Host_Status_f (void)
|
||||||
print_fn ("ipx: %s\n", my_ipx_address);
|
print_fn ("ipx: %s\n", my_ipx_address);
|
||||||
print_fn ("map: %s\n", sv.name);
|
print_fn ("map: %s\n", sv.name);
|
||||||
print_fn ("players: %i active (%i max)\n\n", net_activeconnections, svs.maxclients);
|
print_fn ("players: %i active (%i max)\n\n", net_activeconnections, svs.maxclients);
|
||||||
for (j=0, client = svs.clients ; j<svs.maxclients ; j++, client++)
|
for (j = 0, client = svs.clients; j < svs.maxclients; j++, client++)
|
||||||
{
|
{
|
||||||
if (!client->active)
|
if (!client->active)
|
||||||
continue;
|
continue;
|
||||||
|
@ -753,12 +760,12 @@ void Host_Ping_f (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
SV_ClientPrintf ("Client ping times:\n");
|
SV_ClientPrintf ("Client ping times:\n");
|
||||||
for (i=0, client = svs.clients ; i<svs.maxclients ; i++, client++)
|
for (i = 0, client = svs.clients; i < svs.maxclients; i++, client++)
|
||||||
{
|
{
|
||||||
if (!client->active)
|
if (!client->active)
|
||||||
continue;
|
continue;
|
||||||
total = 0;
|
total = 0;
|
||||||
for (j=0 ; j<NUM_PING_TIMES ; j++)
|
for (j = 0; j < NUM_PING_TIMES; j++)
|
||||||
total+=client->ping_times[j];
|
total+=client->ping_times[j];
|
||||||
total /= NUM_PING_TIMES;
|
total /= NUM_PING_TIMES;
|
||||||
SV_ClientPrintf ("%4i %s\n", (int)(total*1000), client->name);
|
SV_ClientPrintf ("%4i %s\n", (int)(total*1000), client->name);
|
||||||
|
@ -822,7 +829,7 @@ void Host_Map_f (void)
|
||||||
SCR_BeginLoadingPlaque ();
|
SCR_BeginLoadingPlaque ();
|
||||||
|
|
||||||
cls.mapstring[0] = 0;
|
cls.mapstring[0] = 0;
|
||||||
for (i=0 ; i<Cmd_Argc() ; i++)
|
for (i = 0; i < Cmd_Argc(); i++)
|
||||||
{
|
{
|
||||||
strcat (cls.mapstring, Cmd_Argv(i));
|
strcat (cls.mapstring, Cmd_Argv(i));
|
||||||
strcat (cls.mapstring, " ");
|
strcat (cls.mapstring, " ");
|
||||||
|
@ -839,7 +846,7 @@ void Host_Map_f (void)
|
||||||
{
|
{
|
||||||
strcpy (cls.spawnparms, "");
|
strcpy (cls.spawnparms, "");
|
||||||
|
|
||||||
for (i=2 ; i<Cmd_Argc() ; i++)
|
for (i = 2; i < Cmd_Argc(); i++)
|
||||||
{
|
{
|
||||||
strcat (cls.spawnparms, Cmd_Argv(i));
|
strcat (cls.spawnparms, Cmd_Argv(i));
|
||||||
strcat (cls.spawnparms, " ");
|
strcat (cls.spawnparms, " ");
|
||||||
|
@ -966,15 +973,17 @@ void Host_SavegameComment (char *text)
|
||||||
int i;
|
int i;
|
||||||
char kills[20];
|
char kills[20];
|
||||||
|
|
||||||
for (i=0 ; i<SAVEGAME_COMMENT_LENGTH ; i++)
|
for (i = 0; i < SAVEGAME_COMMENT_LENGTH; i++)
|
||||||
text[i] = ' ';
|
text[i] = ' ';
|
||||||
memcpy (text, cl.levelname, min(strlen(cl.levelname),22)); //johnfitz -- only copy 22 chars.
|
memcpy (text, cl.levelname, min(strlen(cl.levelname),22)); //johnfitz -- only copy 22 chars.
|
||||||
sprintf (kills,"kills:%3i/%3i", cl.stats[STAT_MONSTERS], cl.stats[STAT_TOTALMONSTERS]);
|
sprintf (kills,"kills:%3i/%3i", cl.stats[STAT_MONSTERS], cl.stats[STAT_TOTALMONSTERS]);
|
||||||
memcpy (text+22, kills, strlen(kills));
|
memcpy (text+22, kills, strlen(kills));
|
||||||
// convert space to _ to make stdio happy
|
// convert space to _ to make stdio happy
|
||||||
for (i=0 ; i<SAVEGAME_COMMENT_LENGTH ; i++)
|
for (i = 0; i < SAVEGAME_COMMENT_LENGTH; i++)
|
||||||
|
{
|
||||||
if (text[i] == ' ')
|
if (text[i] == ' ')
|
||||||
text[i] = '_';
|
text[i] = '_';
|
||||||
|
}
|
||||||
text[SAVEGAME_COMMENT_LENGTH] = '\0';
|
text[SAVEGAME_COMMENT_LENGTH] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1047,7 +1056,7 @@ void Host_Savegame_f (void)
|
||||||
fprintf (f, "%i\n", SAVEGAME_VERSION);
|
fprintf (f, "%i\n", SAVEGAME_VERSION);
|
||||||
Host_SavegameComment (comment);
|
Host_SavegameComment (comment);
|
||||||
fprintf (f, "%s\n", comment);
|
fprintf (f, "%s\n", comment);
|
||||||
for (i=0 ; i<NUM_SPAWN_PARMS ; i++)
|
for (i = 0; i < NUM_SPAWN_PARMS; i++)
|
||||||
fprintf (f, "%f\n", svs.clients->spawn_parms[i]);
|
fprintf (f, "%f\n", svs.clients->spawn_parms[i]);
|
||||||
fprintf (f, "%d\n", current_skill);
|
fprintf (f, "%d\n", current_skill);
|
||||||
fprintf (f, "%s\n", sv.name);
|
fprintf (f, "%s\n", sv.name);
|
||||||
|
@ -1055,7 +1064,7 @@ void Host_Savegame_f (void)
|
||||||
|
|
||||||
// write the light styles
|
// write the light styles
|
||||||
|
|
||||||
for (i=0 ; i<MAX_LIGHTSTYLES ; i++)
|
for (i = 0; i < MAX_LIGHTSTYLES; i++)
|
||||||
{
|
{
|
||||||
if (sv.lightstyles[i])
|
if (sv.lightstyles[i])
|
||||||
fprintf (f, "%s\n", sv.lightstyles[i]);
|
fprintf (f, "%s\n", sv.lightstyles[i]);
|
||||||
|
@ -1065,7 +1074,7 @@ void Host_Savegame_f (void)
|
||||||
|
|
||||||
|
|
||||||
ED_WriteGlobals (f);
|
ED_WriteGlobals (f);
|
||||||
for (i=0 ; i<sv.num_edicts ; i++)
|
for (i = 0; i < sv.num_edicts; i++)
|
||||||
{
|
{
|
||||||
ED_Write (f, EDICT_NUM(i));
|
ED_Write (f, EDICT_NUM(i));
|
||||||
fflush (f);
|
fflush (f);
|
||||||
|
@ -1127,7 +1136,7 @@ void Host_Loadgame_f (void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
fscanf (f, "%s\n", str);
|
fscanf (f, "%s\n", str);
|
||||||
for (i=0 ; i<NUM_SPAWN_PARMS ; i++)
|
for (i = 0; i < NUM_SPAWN_PARMS; i++)
|
||||||
fscanf (f, "%f\n", &spawn_parms[i]);
|
fscanf (f, "%f\n", &spawn_parms[i]);
|
||||||
// this silliness is so we can load 1.06 save files, which have float skill values
|
// this silliness is so we can load 1.06 save files, which have float skill values
|
||||||
fscanf (f, "%f\n", &tfloat);
|
fscanf (f, "%f\n", &tfloat);
|
||||||
|
@ -1151,7 +1160,7 @@ void Host_Loadgame_f (void)
|
||||||
|
|
||||||
// load the light styles
|
// load the light styles
|
||||||
|
|
||||||
for (i=0 ; i<MAX_LIGHTSTYLES ; i++)
|
for (i = 0; i < MAX_LIGHTSTYLES; i++)
|
||||||
{
|
{
|
||||||
fscanf (f, "%s\n", str);
|
fscanf (f, "%s\n", str);
|
||||||
sv.lightstyles[i] = (char *) Hunk_Alloc (strlen(str)+1);
|
sv.lightstyles[i] = (char *) Hunk_Alloc (strlen(str)+1);
|
||||||
|
@ -1162,7 +1171,7 @@ void Host_Loadgame_f (void)
|
||||||
entnum = -1; // -1 is the globals
|
entnum = -1; // -1 is the globals
|
||||||
while (!feof(f))
|
while (!feof(f))
|
||||||
{
|
{
|
||||||
for (i=0 ; i<sizeof(str)-1 ; i++)
|
for (i = 0; i < sizeof(str) - 1; i++)
|
||||||
{
|
{
|
||||||
r = fgetc (f);
|
r = fgetc (f);
|
||||||
if (r == EOF || !r)
|
if (r == EOF || !r)
|
||||||
|
@ -1174,7 +1183,7 @@ void Host_Loadgame_f (void)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (i == sizeof(str)-1)
|
if (i == sizeof(str) - 1)
|
||||||
Sys_Error ("Loadgame buffer overflow");
|
Sys_Error ("Loadgame buffer overflow");
|
||||||
str[i] = 0;
|
str[i] = 0;
|
||||||
start = str;
|
start = str;
|
||||||
|
@ -1209,7 +1218,7 @@ void Host_Loadgame_f (void)
|
||||||
|
|
||||||
fclose (f);
|
fclose (f);
|
||||||
|
|
||||||
for (i=0 ; i<NUM_SPAWN_PARMS ; i++)
|
for (i = 0; i < NUM_SPAWN_PARMS; i++)
|
||||||
svs.clients->spawn_parms[i] = spawn_parms[i];
|
svs.clients->spawn_parms[i] = spawn_parms[i];
|
||||||
|
|
||||||
if (cls.state != ca_dedicated)
|
if (cls.state != ca_dedicated)
|
||||||
|
@ -1252,8 +1261,10 @@ void Host_Name_f (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (host_client->name[0] && strcmp(host_client->name, "unconnected") )
|
if (host_client->name[0] && strcmp(host_client->name, "unconnected") )
|
||||||
|
{
|
||||||
if (Q_strcmp(host_client->name, newName) != 0)
|
if (Q_strcmp(host_client->name, newName) != 0)
|
||||||
Con_Printf ("%s renamed to %s\n", host_client->name, newName);
|
Con_Printf ("%s renamed to %s\n", host_client->name, newName);
|
||||||
|
}
|
||||||
Q_strcpy (host_client->name, newName);
|
Q_strcpy (host_client->name, newName);
|
||||||
host_client->edict->v.netname = PR_SetEngineString(host_client->name);
|
host_client->edict->v.netname = PR_SetEngineString(host_client->name);
|
||||||
|
|
||||||
|
@ -1603,7 +1614,7 @@ void Host_Spawn_f (void)
|
||||||
MSG_WriteByte (&host_client->message, svc_time);
|
MSG_WriteByte (&host_client->message, svc_time);
|
||||||
MSG_WriteFloat (&host_client->message, sv.time);
|
MSG_WriteFloat (&host_client->message, sv.time);
|
||||||
|
|
||||||
for (i=0, client = svs.clients ; i<svs.maxclients ; i++, client++)
|
for (i = 0, client = svs.clients; i < svs.maxclients; i++, client++)
|
||||||
{
|
{
|
||||||
MSG_WriteByte (&host_client->message, svc_updatename);
|
MSG_WriteByte (&host_client->message, svc_updatename);
|
||||||
MSG_WriteByte (&host_client->message, i);
|
MSG_WriteByte (&host_client->message, i);
|
||||||
|
@ -1617,7 +1628,7 @@ void Host_Spawn_f (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
// send all current light styles
|
// send all current light styles
|
||||||
for (i=0 ; i<MAX_LIGHTSTYLES ; i++)
|
for (i = 0; i < MAX_LIGHTSTYLES; i++)
|
||||||
{
|
{
|
||||||
MSG_WriteByte (&host_client->message, svc_lightstyle);
|
MSG_WriteByte (&host_client->message, svc_lightstyle);
|
||||||
MSG_WriteByte (&host_client->message, (char)i);
|
MSG_WriteByte (&host_client->message, (char)i);
|
||||||
|
@ -1652,7 +1663,7 @@ void Host_Spawn_f (void)
|
||||||
// with a permanent head tilt
|
// with a permanent head tilt
|
||||||
ent = EDICT_NUM( 1 + (host_client - svs.clients) );
|
ent = EDICT_NUM( 1 + (host_client - svs.clients) );
|
||||||
MSG_WriteByte (&host_client->message, svc_setangle);
|
MSG_WriteByte (&host_client->message, svc_setangle);
|
||||||
for (i=0 ; i < 2 ; i++)
|
for (i = 0; i < 2; i++)
|
||||||
MSG_WriteAngle (&host_client->message, ent->v.angles[i] );
|
MSG_WriteAngle (&host_client->message, ent->v.angles[i] );
|
||||||
MSG_WriteAngle (&host_client->message, 0 );
|
MSG_WriteAngle (&host_client->message, 0 );
|
||||||
|
|
||||||
|
@ -1842,9 +1853,9 @@ void Host_Give_f (void)
|
||||||
if (val)
|
if (val)
|
||||||
val->_float = v;
|
val->_float = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
sv_player->v.ammo_shells = v;
|
sv_player->v.ammo_shells = v;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'n':
|
case 'n':
|
||||||
if (rogue)
|
if (rogue)
|
||||||
{
|
{
|
||||||
|
@ -1861,6 +1872,7 @@ void Host_Give_f (void)
|
||||||
sv_player->v.ammo_nails = v;
|
sv_player->v.ammo_nails = v;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'l':
|
case 'l':
|
||||||
if (rogue)
|
if (rogue)
|
||||||
{
|
{
|
||||||
|
@ -1873,6 +1885,7 @@ void Host_Give_f (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'r':
|
case 'r':
|
||||||
if (rogue)
|
if (rogue)
|
||||||
{
|
{
|
||||||
|
@ -1889,6 +1902,7 @@ void Host_Give_f (void)
|
||||||
sv_player->v.ammo_rockets = v;
|
sv_player->v.ammo_rockets = v;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'm':
|
case 'm':
|
||||||
if (rogue)
|
if (rogue)
|
||||||
{
|
{
|
||||||
|
@ -1901,9 +1915,11 @@ void Host_Give_f (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'h':
|
case 'h':
|
||||||
sv_player->v.health = v;
|
sv_player->v.health = v;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'c':
|
case 'c':
|
||||||
if (rogue)
|
if (rogue)
|
||||||
{
|
{
|
||||||
|
@ -1920,6 +1936,7 @@ void Host_Give_f (void)
|
||||||
sv_player->v.ammo_cells = v;
|
sv_player->v.ammo_cells = v;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'p':
|
case 'p':
|
||||||
if (rogue)
|
if (rogue)
|
||||||
{
|
{
|
||||||
|
@ -1932,25 +1949,32 @@ void Host_Give_f (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//johnfitz -- give armour
|
//johnfitz -- give armour
|
||||||
case 'a':
|
case 'a':
|
||||||
if (v > 150)
|
if (v > 150)
|
||||||
{
|
{
|
||||||
sv_player->v.armortype = 0.8;
|
sv_player->v.armortype = 0.8;
|
||||||
sv_player->v.armorvalue = v;
|
sv_player->v.armorvalue = v;
|
||||||
sv_player->v.items = sv_player->v.items - ((int)(sv_player->v.items) & (int)(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) + IT_ARMOR3;
|
sv_player->v.items = sv_player->v.items -
|
||||||
|
((int)(sv_player->v.items) & (int)(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) +
|
||||||
|
IT_ARMOR3;
|
||||||
}
|
}
|
||||||
else if (v > 100)
|
else if (v > 100)
|
||||||
{
|
{
|
||||||
sv_player->v.armortype = 0.6;
|
sv_player->v.armortype = 0.6;
|
||||||
sv_player->v.armorvalue = v;
|
sv_player->v.armorvalue = v;
|
||||||
sv_player->v.items = sv_player->v.items - ((int)(sv_player->v.items) & (int)(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) + IT_ARMOR2;
|
sv_player->v.items = sv_player->v.items -
|
||||||
|
((int)(sv_player->v.items) & (int)(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) +
|
||||||
|
IT_ARMOR2;
|
||||||
}
|
}
|
||||||
else if (v >= 0)
|
else if (v >= 0)
|
||||||
{
|
{
|
||||||
sv_player->v.armortype = 0.3;
|
sv_player->v.armortype = 0.3;
|
||||||
sv_player->v.armorvalue = v;
|
sv_player->v.armorvalue = v;
|
||||||
sv_player->v.items = sv_player->v.items - ((int)(sv_player->v.items) & (int)(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) + IT_ARMOR1;
|
sv_player->v.items = sv_player->v.items -
|
||||||
|
((int)(sv_player->v.items) & (int)(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) +
|
||||||
|
IT_ARMOR1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
//johnfitz
|
//johnfitz
|
||||||
|
@ -2051,7 +2075,7 @@ void Host_Viewframe_f (void)
|
||||||
|
|
||||||
f = atoi(Cmd_Argv(1));
|
f = atoi(Cmd_Argv(1));
|
||||||
if (f >= m->numframes)
|
if (f >= m->numframes)
|
||||||
f = m->numframes-1;
|
f = m->numframes - 1;
|
||||||
|
|
||||||
e->v.frame = f;
|
e->v.frame = f;
|
||||||
}
|
}
|
||||||
|
@ -2144,7 +2168,7 @@ void Host_Startdemos_f (void)
|
||||||
}
|
}
|
||||||
Con_Printf ("%i demo(s) in loop\n", c);
|
Con_Printf ("%i demo(s) in loop\n", c);
|
||||||
|
|
||||||
for (i=1 ; i<c+1 ; i++)
|
for (i = 1; i < c + 1; i++)
|
||||||
strncpy (cls.demos[i-1], Cmd_Argv(i), sizeof(cls.demos[0])-1);
|
strncpy (cls.demos[i-1], Cmd_Argv(i), sizeof(cls.demos[0])-1);
|
||||||
|
|
||||||
if (!sv.active && cls.demonum != -1 && !cls.demoplayback)
|
if (!sv.active && cls.demonum != -1 && !cls.demoplayback)
|
||||||
|
@ -2254,3 +2278,4 @@ void Host_InitCommands (void)
|
||||||
|
|
||||||
Cmd_AddCommand ("mcache", Mod_Print);
|
Cmd_AddCommand ("mcache", Mod_Print);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
76
Quake/menu.c
76
Quake/menu.c
|
@ -422,7 +422,7 @@ void M_SinglePlayer_Key (int key)
|
||||||
|
|
||||||
int load_cursor; // 0 < load_cursor < MAX_SAVEGAMES
|
int load_cursor; // 0 < load_cursor < MAX_SAVEGAMES
|
||||||
|
|
||||||
#define MAX_SAVEGAMES 20 //johnfitz -- increased from 12
|
#define MAX_SAVEGAMES 20 /* johnfitz -- increased from 12 */
|
||||||
char m_filenames[MAX_SAVEGAMES][SAVEGAME_COMMENT_LENGTH+1];
|
char m_filenames[MAX_SAVEGAMES][SAVEGAME_COMMENT_LENGTH+1];
|
||||||
int loadable[MAX_SAVEGAMES];
|
int loadable[MAX_SAVEGAMES];
|
||||||
|
|
||||||
|
@ -433,7 +433,7 @@ void M_ScanSaves (void)
|
||||||
FILE *f;
|
FILE *f;
|
||||||
int version;
|
int version;
|
||||||
|
|
||||||
for (i=0 ; i<MAX_SAVEGAMES ; i++)
|
for (i = 0; i < MAX_SAVEGAMES; i++)
|
||||||
{
|
{
|
||||||
strcpy (m_filenames[i], "--- UNUSED SLOT ---");
|
strcpy (m_filenames[i], "--- UNUSED SLOT ---");
|
||||||
loadable[i] = false;
|
loadable[i] = false;
|
||||||
|
@ -446,9 +446,11 @@ void M_ScanSaves (void)
|
||||||
strncpy (m_filenames[i], name, sizeof(m_filenames[i])-1);
|
strncpy (m_filenames[i], name, sizeof(m_filenames[i])-1);
|
||||||
|
|
||||||
// change _ back to space
|
// change _ back to space
|
||||||
for (j=0 ; j<SAVEGAME_COMMENT_LENGTH ; j++)
|
for (j = 0; j < SAVEGAME_COMMENT_LENGTH; j++)
|
||||||
|
{
|
||||||
if (m_filenames[i][j] == '_')
|
if (m_filenames[i][j] == '_')
|
||||||
m_filenames[i][j] = ' ';
|
m_filenames[i][j] = ' ';
|
||||||
|
}
|
||||||
loadable[i] = true;
|
loadable[i] = true;
|
||||||
fclose (f);
|
fclose (f);
|
||||||
}
|
}
|
||||||
|
@ -490,7 +492,7 @@ void M_Load_Draw (void)
|
||||||
p = Draw_CachePic ("gfx/p_load.lmp");
|
p = Draw_CachePic ("gfx/p_load.lmp");
|
||||||
M_DrawPic ( (320-p->width)/2, 4, p);
|
M_DrawPic ( (320-p->width)/2, 4, p);
|
||||||
|
|
||||||
for (i=0 ; i< MAX_SAVEGAMES; i++)
|
for (i = 0; i < MAX_SAVEGAMES; i++)
|
||||||
M_Print (16, 32 + 8*i, m_filenames[i]);
|
M_Print (16, 32 + 8*i, m_filenames[i]);
|
||||||
|
|
||||||
// line cursor
|
// line cursor
|
||||||
|
@ -506,7 +508,7 @@ void M_Save_Draw (void)
|
||||||
p = Draw_CachePic ("gfx/p_save.lmp");
|
p = Draw_CachePic ("gfx/p_save.lmp");
|
||||||
M_DrawPic ( (320-p->width)/2, 4, p);
|
M_DrawPic ( (320-p->width)/2, 4, p);
|
||||||
|
|
||||||
for (i=0 ; i<MAX_SAVEGAMES ; i++)
|
for (i = 0; i < MAX_SAVEGAMES; i++)
|
||||||
M_Print (16, 32 + 8*i, m_filenames[i]);
|
M_Print (16, 32 + 8*i, m_filenames[i]);
|
||||||
|
|
||||||
// line cursor
|
// line cursor
|
||||||
|
@ -1172,7 +1174,7 @@ void M_DrawSlider (int x, int y, float range)
|
||||||
if (range > 1)
|
if (range > 1)
|
||||||
range = 1;
|
range = 1;
|
||||||
M_DrawCharacter (x-8, y, 128);
|
M_DrawCharacter (x-8, y, 128);
|
||||||
for (i=0 ; i<SLIDER_RANGE ; i++)
|
for (i = 0; i < SLIDER_RANGE; i++)
|
||||||
M_DrawCharacter (x + i*8, y, 129);
|
M_DrawCharacter (x + i*8, y, 129);
|
||||||
M_DrawCharacter (x+i*8, y, 130);
|
M_DrawCharacter (x+i*8, y, 130);
|
||||||
M_DrawCharacter (x + (SLIDER_RANGE-1)*8 * range, y, 131);
|
M_DrawCharacter (x + (SLIDER_RANGE-1)*8 * range, y, 131);
|
||||||
|
@ -1337,24 +1339,24 @@ void M_Options_Key (int k)
|
||||||
|
|
||||||
char *bindnames[][2] =
|
char *bindnames[][2] =
|
||||||
{
|
{
|
||||||
{"+attack", "attack"},
|
{"+attack", "attack"},
|
||||||
{"impulse 10", "change weapon"},
|
{"impulse 10", "change weapon"},
|
||||||
{"+jump", "jump / swim up"},
|
{"+jump", "jump / swim up"},
|
||||||
{"+forward", "walk forward"},
|
{"+forward", "walk forward"},
|
||||||
{"+back", "backpedal"},
|
{"+back", "backpedal"},
|
||||||
{"+left", "turn left"},
|
{"+left", "turn left"},
|
||||||
{"+right", "turn right"},
|
{"+right", "turn right"},
|
||||||
{"+speed", "run"},
|
{"+speed", "run"},
|
||||||
{"+moveleft", "step left"},
|
{"+moveleft", "step left"},
|
||||||
{"+moveright", "step right"},
|
{"+moveright", "step right"},
|
||||||
{"+strafe", "sidestep"},
|
{"+strafe", "sidestep"},
|
||||||
{"+lookup", "look up"},
|
{"+lookup", "look up"},
|
||||||
{"+lookdown", "look down"},
|
{"+lookdown", "look down"},
|
||||||
{"centerview", "center view"},
|
{"centerview", "center view"},
|
||||||
{"+mlook", "mouse look"},
|
{"+mlook", "mouse look"},
|
||||||
{"+klook", "keyboard look"},
|
{"+klook", "keyboard look"},
|
||||||
{"+moveup", "swim up"},
|
{"+moveup", "swim up"},
|
||||||
{"+movedown", "swim down"}
|
{"+movedown", "swim down"}
|
||||||
};
|
};
|
||||||
|
|
||||||
#define NUMCOMMANDS (sizeof(bindnames)/sizeof(bindnames[0]))
|
#define NUMCOMMANDS (sizeof(bindnames)/sizeof(bindnames[0]))
|
||||||
|
@ -1382,7 +1384,7 @@ void M_FindKeysForCommand (char *command, int *twokeys)
|
||||||
l = strlen(command);
|
l = strlen(command);
|
||||||
count = 0;
|
count = 0;
|
||||||
|
|
||||||
for (j=0 ; j<256 ; j++)
|
for (j = 0; j < 256; j++)
|
||||||
{
|
{
|
||||||
b = keybindings[j];
|
b = keybindings[j];
|
||||||
if (!b)
|
if (!b)
|
||||||
|
@ -1405,7 +1407,7 @@ void M_UnbindCommand (char *command)
|
||||||
|
|
||||||
l = strlen(command);
|
l = strlen(command);
|
||||||
|
|
||||||
for (j=0 ; j<256 ; j++)
|
for (j = 0; j < 256; j++)
|
||||||
{
|
{
|
||||||
b = keybindings[j];
|
b = keybindings[j];
|
||||||
if (!b)
|
if (!b)
|
||||||
|
@ -1433,7 +1435,7 @@ void M_Keys_Draw (void)
|
||||||
M_Print (18, 32, "Enter to change, backspace to clear");
|
M_Print (18, 32, "Enter to change, backspace to clear");
|
||||||
|
|
||||||
// search for known bindings
|
// search for known bindings
|
||||||
for (i=0 ; i<NUMCOMMANDS ; i++)
|
for (i = 0; i < NUMCOMMANDS; i++)
|
||||||
{
|
{
|
||||||
y = 48 + 8*i;
|
y = 48 + 8*i;
|
||||||
|
|
||||||
|
@ -1715,8 +1717,10 @@ void M_Menu_SerialConfig_f (void)
|
||||||
|
|
||||||
// map uart's port to COMx
|
// map uart's port to COMx
|
||||||
for (n = 0; n < 4; n++)
|
for (n = 0; n < 4; n++)
|
||||||
|
{
|
||||||
if (ISA_uarts[n] == port)
|
if (ISA_uarts[n] == port)
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
if (n == 4)
|
if (n == 4)
|
||||||
{
|
{
|
||||||
n = 0;
|
n = 0;
|
||||||
|
@ -1726,8 +1730,10 @@ void M_Menu_SerialConfig_f (void)
|
||||||
|
|
||||||
// map baudrate to index
|
// map baudrate to index
|
||||||
for (n = 0; n < 6; n++)
|
for (n = 0; n < 6; n++)
|
||||||
|
{
|
||||||
if (serialConfig_baudrate[n] == baudrate)
|
if (serialConfig_baudrate[n] == baudrate)
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
if (n == 6)
|
if (n == 6)
|
||||||
n = 5;
|
n = 5;
|
||||||
serialConfig_baud = n;
|
serialConfig_baud = n;
|
||||||
|
@ -2596,23 +2602,23 @@ void M_GameOptions_Draw (void)
|
||||||
M_Print (160, 96, va("%i minutes", (int)timelimit.value));
|
M_Print (160, 96, va("%i minutes", (int)timelimit.value));
|
||||||
|
|
||||||
M_Print (0, 112, " Episode");
|
M_Print (0, 112, " Episode");
|
||||||
//MED 01/06/97 added hipnotic episodes
|
// MED 01/06/97 added hipnotic episodes
|
||||||
if (hipnotic)
|
if (hipnotic)
|
||||||
M_Print (160, 112, hipnoticepisodes[startepisode].description);
|
M_Print (160, 112, hipnoticepisodes[startepisode].description);
|
||||||
//PGM 01/07/97 added rogue episodes
|
// PGM 01/07/97 added rogue episodes
|
||||||
else if (rogue)
|
else if (rogue)
|
||||||
M_Print (160, 112, rogueepisodes[startepisode].description);
|
M_Print (160, 112, rogueepisodes[startepisode].description);
|
||||||
else
|
else
|
||||||
M_Print (160, 112, episodes[startepisode].description);
|
M_Print (160, 112, episodes[startepisode].description);
|
||||||
|
|
||||||
M_Print (0, 120, " Level");
|
M_Print (0, 120, " Level");
|
||||||
//MED 01/06/97 added hipnotic episodes
|
// MED 01/06/97 added hipnotic episodes
|
||||||
if (hipnotic)
|
if (hipnotic)
|
||||||
{
|
{
|
||||||
M_Print (160, 120, hipnoticlevels[hipnoticepisodes[startepisode].firstLevel + startlevel].description);
|
M_Print (160, 120, hipnoticlevels[hipnoticepisodes[startepisode].firstLevel + startlevel].description);
|
||||||
M_Print (160, 128, hipnoticlevels[hipnoticepisodes[startepisode].firstLevel + startlevel].name);
|
M_Print (160, 128, hipnoticlevels[hipnoticepisodes[startepisode].firstLevel + startlevel].name);
|
||||||
}
|
}
|
||||||
//PGM 01/07/97 added rogue episodes
|
// PGM 01/07/97 added rogue episodes
|
||||||
else if (rogue)
|
else if (rogue)
|
||||||
{
|
{
|
||||||
M_Print (160, 120, roguelevels[rogueepisodes[startepisode].firstLevel + startlevel].description);
|
M_Print (160, 120, roguelevels[rogueepisodes[startepisode].firstLevel + startlevel].description);
|
||||||
|
@ -2903,7 +2909,9 @@ void M_ServerList_Draw (void)
|
||||||
int i,j;
|
int i,j;
|
||||||
hostcache_t temp;
|
hostcache_t temp;
|
||||||
for (i = 0; i < hostCacheCount; i++)
|
for (i = 0; i < hostCacheCount; i++)
|
||||||
for (j = i+1; j < hostCacheCount; j++)
|
{
|
||||||
|
for (j = i + 1; j < hostCacheCount; j++)
|
||||||
|
{
|
||||||
if (strcmp(hostcache[j].name, hostcache[i].name) < 0)
|
if (strcmp(hostcache[j].name, hostcache[i].name) < 0)
|
||||||
{
|
{
|
||||||
Q_memcpy(&temp, &hostcache[j], sizeof(hostcache_t));
|
Q_memcpy(&temp, &hostcache[j], sizeof(hostcache_t));
|
||||||
|
@ -2911,6 +2919,8 @@ void M_ServerList_Draw (void)
|
||||||
Q_memcpy(&hostcache[i], &temp, sizeof(hostcache_t));
|
Q_memcpy(&hostcache[i], &temp, sizeof(hostcache_t));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
slist_sorted = true;
|
slist_sorted = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3199,7 +3209,6 @@ void M_Keydown (int key)
|
||||||
void M_ConfigureNetSubsystem(void)
|
void M_ConfigureNetSubsystem(void)
|
||||||
{
|
{
|
||||||
// enable/disable net systems to match desired config
|
// enable/disable net systems to match desired config
|
||||||
|
|
||||||
Cbuf_AddText ("stopdemo\n");
|
Cbuf_AddText ("stopdemo\n");
|
||||||
if (SerialConfig || DirectConfig)
|
if (SerialConfig || DirectConfig)
|
||||||
{
|
{
|
||||||
|
@ -3209,3 +3218,4 @@ void M_ConfigureNetSubsystem(void)
|
||||||
if (IPXConfig || TCPIPConfig)
|
if (IPXConfig || TCPIPConfig)
|
||||||
net_hostport = lanConfig_port;
|
net_hostport = lanConfig_port;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue