Cbuf_AddText ("maxplayers 1\n");
Cbuf_AddText ("deathmatch 0\n");
Cbuf_AddText ("coop 0\n");
- if (gamemode == GAME_NEHAHRA)
- Cbuf_AddText ("map nehstart\n");
- else if (gamemode == GAME_TRANSFUSION)
- Cbuf_AddText ("map e1m1\n");
- else
- Cbuf_AddText ("map start\n");
+ Cbuf_AddText ("startmap_sp\n");
break;
case 1:
void M_ScanSaves (void)
{
- int i, j;
+ int i, j, len;
char name[MAX_OSPATH];
- char *str;
+ char buf[SAVEGAME_COMMENT_LENGTH + 256];
+ const char *t;
qfile_t *f;
int version;
strcpy (m_filenames[i], "--- UNUSED SLOT ---");
loadable[i] = false;
sprintf (name, "s%i.sav", i);
- f = FS_Open (name, "r", false);
+ f = FS_Open (name, "rb", false);
if (!f)
continue;
- str = FS_Getline (f);
- sscanf (str, "%i\n", &version);
- str = FS_Getline (f);
- strlcpy (m_filenames[i], str, sizeof (m_filenames[i]));
+ // read enough to get the comment
+ len = FS_Read(f, buf, sizeof(buf) - 1);
+ buf[sizeof(buf) - 1] = 0;
+ t = buf;
+ // version
+ COM_ParseToken(&t, false);
+ version = atoi(com_token);
+ // description
+ COM_ParseToken(&t, false);
+ strlcpy (m_filenames[i], com_token, sizeof (m_filenames[i]));
// change _ back to space
for (j=0 ; j<SAVEGAME_COMMENT_LENGTH ; j++)
{
int optnum;
S_LocalSound ("sound/misc/menu3.wav");
-
+
optnum = 0;
if (options_graphics_cursor == optnum++) Cvar_SetValueQuick (&r_shadow_gloss, bound(0, r_shadow_gloss.integer + dir, 2));
if (gamemode == GAME_GOODVSBAD2)
break;
Cvar_SetValueQuick (&skill, skill.integer + dir);
- if (skill.integer > 3)
- Cvar_SetValueQuick (&skill, 0);
- if (skill.integer < 0)
- Cvar_SetValueQuick (&skill, 3);
+ if (gamemode == GAME_TRANSFUSION)
+ {
+ if (skill.integer > 4)
+ Cvar_SetValueQuick (&skill, 0);
+ if (skill.integer < 0)
+ Cvar_SetValueQuick (&skill, 4);
+ }
+ else
+ {
+ if (skill.integer > 3)
+ Cvar_SetValueQuick (&skill, 0);
+ if (skill.integer < 0)
+ Cvar_SetValueQuick (&skill, 3);
+ }
break;
case 5:
if (*m_return_reason)
M_Print(16, menu_height - 8, m_return_reason);
y = 48;
- visible = (menu_height - 16 - y) / 8;
+ visible = (menu_height - 16 - y) / 8 / 2;
start = bound(0, slist_cursor - (visible >> 1), hostcache_viewcount - visible);
end = min(start + visible, hostcache_viewcount);
case K_ENTER:
S_LocalSound ("sound/misc/menu2.wav");
- Cbuf_AddText(va("connect \"%s\"\n", hostcache_viewset[slist_cursor]->info.cname));
+ if (hostcache_viewcount)
+ Cbuf_AddText(va("connect \"%s\"\n", hostcache_viewset[slist_cursor]->info.cname));
break;
default:
{
// reset key_dest
key_dest = key_game;
+
+ Mem_FreePool (&menu_mempool);
}
void M_Restart(void)
// COMMANDLINEOPTION: Client: -useqmenu causes the first time you open the menu to use the quake menu, then reverts to menu.dat (if forceqmenu is 0)
if(COM_CheckParm("-useqmenu"))
MR_SetRouting (TRUE);
- else
+ else
MR_SetRouting (FALSE);
}