Report next intended position instead of current position to server

Fixes rare issues like where you can land on a block then jump off it again without the server noticing
This commit is contained in:
UnknownShadow200 2021-01-24 08:33:13 +11:00
parent e66649b285
commit dfdf1e150d

View File

@ -737,9 +737,12 @@ static void Classic_Reset(void) {
}
static void Classic_Tick(void) {
struct Entity* p = &LocalPlayer_Instance.Base;
struct LocalPlayer* p = &LocalPlayer_Instance;
struct Entity* e = &LocalPlayer_Instance.Base;
if (!classic_receivedFirstPos) return;
Classic_WritePosition(p->Position, p->Yaw, p->Pitch);
/* Report end position of each physics tick, rather than current position */
/* (otherwise can miss landing on a block then jumping off of it again) */
Classic_WritePosition(p->Interp.Next.Pos, e->Yaw, e->Pitch);
}