Make sure runstandardplayerphysics builtin properly initialises everything it needs.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@6308 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2023-01-09 05:11:23 +00:00
parent 2e84a3b96a
commit 3a6f22d05c
2 changed files with 15 additions and 5 deletions

View File

@ -2568,6 +2568,7 @@ void CL_CheckServerInfo(void)
// movement vars for prediction
cl.bunnyspeedcap = Q_atof(InfoBuf_ValueForKey(&cl.serverinfo, "pm_bunnyspeedcap"));
movevars.slidefix = (Q_atof(InfoBuf_ValueForKey(&cl.serverinfo, "pm_slidefix")) != 0);
movevars.slidyslopes = (Q_atof(InfoBuf_ValueForKey(&cl.serverinfo, "pm_slidyslopes")) != 0);
movevars.airstep = (Q_atof(InfoBuf_ValueForKey(&cl.serverinfo, "pm_airstep")) != 0);
movevars.pground = (Q_atof(InfoBuf_ValueForKey(&cl.serverinfo, "pm_pground")) != 0);
movevars.stepdown = (Q_atof(InfoBuf_ValueForKey(&cl.serverinfo, "pm_stepdown")) != 0);

View File

@ -4268,16 +4268,24 @@ static void QCBUILTIN PF_cs_runplayerphysics (pubprogfuncs_t *prinst, struct glo
pmove.cmd.sidemove = csqcg.input_movevalues[1];
pmove.cmd.upmove = csqcg.input_movevalues[2];
pmove.cmd.buttons = *csqcg.input_buttons;
pmove.onladder = false;
pmove.safeorigin_known = false;
pmove.capsule = false; //FIXME
movevars.bunnyspeedcap = cl.bunnyspeedcap;
movevars.coordtype = cls.netchan.message.prim.coordtype;
if (csqc_playerseat >= 0 && cl.playerview[csqc_playerseat].playernum+1 == ent->xv->entnum)
{
movevars.entgravity = cl.playerview[csqc_playerseat].entgravity;
movevars.maxspeed = cl.playerview[csqc_playerseat].maxspeed;
}
else
{
movevars.entgravity = 1;
movevars.maxspeed = cl.playerview[0].maxspeed;
}
if (ent->xv->gravity)
movevars.entgravity = ent->xv->gravity;
else if (csqc_playerseat >= 0 && cl.playerview[csqc_playerseat].playernum+1 == ent->xv->entnum)
movevars.entgravity = cl.playerview[csqc_playerseat].entgravity;
else
movevars.entgravity = 1;
if (ent->xv->entnum)
pmove.skipent = ent->xv->entnum;
@ -4300,11 +4308,12 @@ static void QCBUILTIN PF_cs_runplayerphysics (pubprogfuncs_t *prinst, struct glo
}
pmove.jump_held = (int)ent->xv->pmove_flags & PMF_JUMP_HELD;
pmove.waterjumptime = 0;
pmove.onground = (int)ent->v->flags & FL_ONGROUND;
pmove.onground = !!((int)ent->v->flags & FL_ONGROUND);
VectorCopy(ent->v->origin, pmove.origin);
VectorCopy(ent->v->velocity, pmove.velocity);
VectorCopy(ent->v->maxs, pmove.player_maxs);
VectorCopy(ent->v->mins, pmove.player_mins);
VectorCopy(ent->xv->gravitydir, pmove.gravitydir);
CL_SetSolidEntities();