From c769e6fa01e059820ba8b0708dce5a3798de05eb Mon Sep 17 00:00:00 2001 From: Spoike Date: Mon, 9 Jan 2023 05:13:17 +0000 Subject: [PATCH] Fix Q2 saved-game crash. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@6323 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/server/savegame.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/engine/server/savegame.c b/engine/server/savegame.c index 85ab02a0c..3a3ce39b0 100644 --- a/engine/server/savegame.c +++ b/engine/server/savegame.c @@ -1746,22 +1746,23 @@ static void SV_GameLoaded(loadplayer_t *lp, size_t slots, const char *savename) sv.spawned_client_slots++; Q_strncpyz(cl->namebuf, lp[clnum].name, sizeof(cl->namebuf)); } - cl->name = PR_AddString(svprogfuncs, cl->namebuf, sizeof(cl->namebuf), false); - cl->team = PR_AddString(svprogfuncs, cl->teambuf, sizeof(cl->teambuf), false); - cl->edict = EDICT_NUM_PB(svprogfuncs, clnum+1); + if (svprogfuncs) + { + cl->name = PR_AddString(svprogfuncs, cl->namebuf, sizeof(cl->namebuf), false); + cl->team = PR_AddString(svprogfuncs, cl->teambuf, sizeof(cl->teambuf), false); + cl->edict = EDICT_NUM_PB(svprogfuncs, clnum+1); #ifdef HEXEN2 - { if (cl->edict) cl->playerclass = cl->edict->xv->playerclass; else cl->playerclass = 0; - } #endif #ifdef HAVE_LEGACY - cl->edict->xv->clientcolors = cl->playercolor; + cl->edict->xv->clientcolors = cl->playercolor; #endif + } if (cl->state == cs_spawned) //shouldn't have gotten past SV_SpawnServer, but just in case... cl->state = cs_connected; //client needs new serverinfo.