Fix some DispatchUserMessage and nolerp stuff

This commit is contained in:
LightCat 2018-11-17 18:08:56 +01:00
parent 51b360b6b5
commit 0ed8945db7
2 changed files with 6 additions and 5 deletions

View File

@ -252,12 +252,12 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
// if (cl_interpolate->GetInt() != 0) cl_interpolate->SetValue(0);
firstcall = true;
}
else if (!firstcall && !*nolerp)
else if (firstcall)
{
sv_client_min_interp_ratio->SetValue(min_interp);
cl_interp->SetValue(interp_f);
cl_interp_ratio->SetValue(ratio);
firstcall = true;
firstcall = false;
}
if (!g_Settings.bInvalid && CE_GOOD(g_pLocalPlayer->entity))

View File

@ -79,13 +79,14 @@ DEFINE_HOOKED_METHOD(DispatchUserMessage, bool, void *this_, int type,
if (type == 5)
if (buf.GetNumBytesLeft() > 35)
{
char message_name[buf.GetNumBytesLeft()]{};
std::string message_name;
for (int i = 0; i < buf.GetNumBytesLeft(); i++)
{
int byte = buf.ReadByte();
message_name[i] = byte;
message_name.push_back(byte);
}
if (!strcmp(message_name, "TeamChangePending"))
logging::Info("%s", message_name.c_str());
if (message_name.find("TeamChangePending") != message_name.npos)
logging::Info("test, %d %d", int(message_name[0]),
(CE_GOOD(LOCAL_E) ? LOCAL_E->m_IDX : -1));
buf.Seek(0);