From 172cea31868d8cb39ae918999bc385281ff9aed0 Mon Sep 17 00:00:00 2001 From: havoc Date: Wed, 8 Jun 2011 20:32:11 +0000 Subject: [PATCH] fix a crash on saving a game git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11192 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=11affacc847ea4174861a4837fcd8d39e7b81f1c --- host_cmd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; -- 2.39.2