Fix Q2 saved-game crash.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@6323 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2023-01-09 05:13:17 +00:00
parent ed63b7435e
commit c769e6fa01

View file

@ -1746,22 +1746,23 @@ static void SV_GameLoaded(loadplayer_t *lp, size_t slots, const char *savename)
sv.spawned_client_slots++; sv.spawned_client_slots++;
Q_strncpyz(cl->namebuf, lp[clnum].name, sizeof(cl->namebuf)); Q_strncpyz(cl->namebuf, lp[clnum].name, sizeof(cl->namebuf));
} }
if (svprogfuncs)
{
cl->name = PR_AddString(svprogfuncs, cl->namebuf, sizeof(cl->namebuf), false); cl->name = PR_AddString(svprogfuncs, cl->namebuf, sizeof(cl->namebuf), false);
cl->team = PR_AddString(svprogfuncs, cl->teambuf, sizeof(cl->teambuf), false); cl->team = PR_AddString(svprogfuncs, cl->teambuf, sizeof(cl->teambuf), false);
cl->edict = EDICT_NUM_PB(svprogfuncs, clnum+1); cl->edict = EDICT_NUM_PB(svprogfuncs, clnum+1);
#ifdef HEXEN2 #ifdef HEXEN2
{
if (cl->edict) if (cl->edict)
cl->playerclass = cl->edict->xv->playerclass; cl->playerclass = cl->edict->xv->playerclass;
else else
cl->playerclass = 0; cl->playerclass = 0;
}
#endif #endif
#ifdef HAVE_LEGACY #ifdef HAVE_LEGACY
cl->edict->xv->clientcolors = cl->playercolor; cl->edict->xv->clientcolors = cl->playercolor;
#endif #endif
}
if (cl->state == cs_spawned) //shouldn't have gotten past SV_SpawnServer, but just in case... if (cl->state == cs_spawned) //shouldn't have gotten past SV_SpawnServer, but just in case...
cl->state = cs_connected; //client needs new serverinfo. cl->state = cs_connected; //client needs new serverinfo.