]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix a crash on saving a game
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 8 Jun 2011 20:32:11 +0000 (20:32 +0000)
committerRudolf Polzer <divverent@xonotic.org>
Mon, 13 Jun 2011 17:25:42 +0000 (19:25 +0200)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11192 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=11affacc847ea4174861a4837fcd8d39e7b81f1c

host_cmd.c

index 6f368f03ee0310dd61db62695819f208cc078490..b8ac161b373e91de131094e08969e571d8ef20ed 100644 (file)
@@ -700,6 +700,7 @@ Host_Savegame_f
 void Host_Savegame_f (void)
 {
        char    name[MAX_QPATH];
+       qboolean deadflag = false;
 
        if (!sv.active)
        {
@@ -707,6 +708,10 @@ void Host_Savegame_f (void)
                return;
        }
 
+       SV_VM_Begin();
+       deadflag = cl.islocalgame && svs.clients[0].active && PRVM_serveredictfloat(svs.clients[0].edict, deadflag);
+       SV_VM_End();
+
        if (cl.islocalgame)
        {
                // singleplayer checks
@@ -716,7 +721,7 @@ void Host_Savegame_f (void)
                        return;
                }
 
-               if (svs.clients[0].active && PRVM_serveredictfloat(svs.clients[0].edict, deadflag))
+               if (deadflag)
                {
                        Con_Print("Can't savegame with a dead player\n");
                        return;