From c90a76decb7081a727e76c20ba22a6f2c22e8fbc Mon Sep 17 00:00:00 2001 From: fgsfds Date: Fri, 6 Mar 2020 21:35:46 +0300 Subject: [PATCH] network now always ticks at 36 tick --- src/game/g_player.pas | 10 +++++++--- src/game/g_window.pas | 5 ----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/game/g_player.pas b/src/game/g_player.pas index 3e30f63..925f4ce 100644 --- a/src/game/g_player.pas +++ b/src/game/g_player.pas @@ -1437,6 +1437,8 @@ begin e_TextureFontPrint(0, fH * 3, 'Vel Y: ' + IntToStr(p.FObj.Vel.Y), gStdFont); e_TextureFontPrint(0, fH * 4, 'Acc X: ' + IntToStr(p.FObj.Accel.X), gStdFont); e_TextureFontPrint(0, fH * 5, 'Acc Y: ' + IntToStr(p.FObj.Accel.Y), gStdFont); + e_TextureFontPrint(0, fH * 6, 'Old X: ' + IntToStr(p.FObj.oldX), gStdFont); + e_TextureFontPrint(0, fH * 7, 'Old Y: ' + IntToStr(p.FObj.oldY), gStdFont); end; procedure g_Player_DrawHealth(); @@ -3422,6 +3424,9 @@ begin end; FShellTimer := -1; + // have to do this to avoid death tremors + PreUpdate(); + if (gGameSettings.MaxLives > 0) and Srv and (gLMSRespawn = LMS_RESPAWN_NONE) then begin if FLives > 0 then FLives := FLives - 1; @@ -5751,6 +5756,8 @@ procedure TPlayer.SetLerp(XTo, YTo: Integer); var AX, AY: Integer; begin + FXTo := XTo; + FYTo := YTo; if NetInterpLevel < 1 then begin FObj.X := XTo; @@ -5758,9 +5765,6 @@ begin end else begin - FXTo := XTo; - FYTo := YTo; - AX := Abs(FXTo - FObj.X); AY := Abs(FYTo - FObj.Y); if (AX > 32) or (AX <= NetInterpLevel) then diff --git a/src/game/g_window.pas b/src/game/g_window.pas index f55c430..5d1c594 100644 --- a/src/game/g_window.pas +++ b/src/game/g_window.pas @@ -143,11 +143,6 @@ begin else if (NetMode = NET_CLIENT) then g_Net_Client_Update(); Update(); end; - end - else - begin - if (NetMode = NET_SERVER) then g_Net_Host_Update() - else if (NetMode = NET_CLIENT) then g_Net_Client_Update(); end; if NetMode = NET_SERVER then g_Net_Flush(); -- 2.29.2