add m_pCurrentCommand to runengineprediction

it should all work now
This commit is contained in:
F1ssi0N 2016-12-03 11:34:41 +00:00
parent 55cb56196e
commit 59091319a9

View File

@ -751,6 +751,15 @@ void RunEnginePrediction(IClientEntity* ent, CUserCmd *ucmd) {
float frameTime = interfaces::gvars->frametime;
float curTime = interfaces::gvars->curtime;
CUserCmd defaultCmd;
if(ucmd == NULL)
{
ucmd = &defaultCmd;
}
// set the current command
SetEntityValue<void *>(ent, 0x105C, ucmd);
// set up the globals
interfaces::gvars->curtime = gInts->Globals->interval_per_tick * GetEntityValue<int>(ent, eoffsets.nTickBase);
interfaces::gvars->frametime = gInts->Globals->interval_per_tick;
@ -763,6 +772,9 @@ void RunEnginePrediction(IClientEntity* ent, CUserCmd *ucmd) {
oFinishTrackPredictionErrors(ent);
// reset the current command
SetEntityValue<void *>(ent, 0x105C, NULL);
// restore globals
interfaces::gvars->frametime = frametime;
interfaces::gvars->curtime = curTime;