From: havoc Date: Wed, 8 Jun 2011 20:32:11 +0000 (+0000) Subject: fix a crash on saving a game X-Git-Tag: xonotic-v0.6.0~163^2~354 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=11affacc847ea4174861a4837fcd8d39e7b81f1c;p=xonotic%2Fdarkplaces.git fix a crash on saving a game git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11192 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/host_cmd.c b/host_cmd.c index 6f368f03..b8ac161b 100644 --- a/host_cmd.c +++ b/host_cmd.c @@ -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;