]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix loading savegames
authortaniwha <taniwha@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 10 Jun 2001 21:21:41 +0000 (21:21 +0000)
committertaniwha <taniwha@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 10 Jun 2001 21:21:41 +0000 (21:21 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@233 d7cf8633-e32d-0410-b094-e92efae38249

host_cmd.c

index c949589c1949640704726868c6dab1aefdebd24d..b34c09bcb03a71f66c44ec4a6d4eb40a0a786fd8 100644 (file)
@@ -573,7 +573,7 @@ void Host_Loadgame_f (void)
        str = Qgetline (f);
        for (i=0 ; i<NUM_SPAWN_PARMS ; i++) {
                str = Qgetline (f);
-               sscanf (str, "%f\n", &spawn_parms[i]);
+               sscanf (str, "%f", &spawn_parms[i]);
        }
 // this silliness is so we can load 1.06 save files, which have float skill values
        str = Qgetline (f);
@@ -582,6 +582,8 @@ void Host_Loadgame_f (void)
        Cvar_SetValue ("skill", (float)current_skill);
 
        strcpy (mapname, Qgetline (f));
+       mapname[strlen (mapname) -1] = 0; // strip trailing \n
+
        str = Qgetline (f);
        sscanf (str, "%f\n",&time);
 
@@ -601,6 +603,7 @@ void Host_Loadgame_f (void)
        for (i=0 ; i<MAX_LIGHTSTYLES ; i++)
        {
                str = Qgetline (f);
+               str[strlen (str) -1] = 0; // strip trailing \n
                sv.lightstyles[i] = Hunk_AllocName (strlen(str)+1, "lightstyles");
                strcpy (sv.lightstyles[i], str);
        }