Fix .button3 etc failing when loading saved games.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5981 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2021-07-18 12:13:06 +00:00
parent 5154c86611
commit bbd468d1f0

View file

@ -1187,6 +1187,15 @@ void PR_LoadGlabalStruct(qboolean muted)
PR_SV_FillWorldGlobals(&sv.world);
for (i = 0; i < countof(buttonfields); i++)
{
eval_t *val = svprogfuncs->GetEdictFieldValue(svprogfuncs, (edict_t*)sv.world.edicts, buttonfields[i].fieldname, ev_float, NULL);
if (val)
buttonfields[i].offset = (float*)val - (float*)sv.world.edicts->v;
else
buttonfields[i].offset = -1;
}
#ifdef HEXEN2
/*Hexen2 has lots of extra stats, which I don't want special support for, so list them here and send them as for csqc*/
if (progstype == PROG_H2)