diff --git a/src/game/g_player.pas b/src/game/g_player.pas
index db39cb84b0961e1260f840fb8a885e710648b1a8..925f4ce55c6926bcd969f8b52779d2dc19e05308 100644 (file)
--- a/src/game/g_player.pas
+++ b/src/game/g_player.pas
FFireAngle: SmallInt;
FIncCamOld: Integer;
FIncCam: Integer;
+ FSlopeOld: Integer;
FShellTimer: Integer;
FShellType: Byte;
FSawSound: TPlayableSound;
property GameAccelY: Integer read FObj.Accel.Y write FObj.Accel.Y;
property IncCam: Integer read FIncCam write FIncCam;
property IncCamOld: Integer read FIncCamOld write FIncCamOld;
+ property SlopeOld: Integer read FSlopeOld write FSlopeOld;
property UID: Word read FUID write FUID;
property JustTeleported: Boolean read FJustTeleported write FJustTeleported;
property NetTime: LongWord read FNetTime write FNetTime;
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();
procedure TPlayer.DrawIndicator(Color: TRGB);
var
- indX, indY, fX, fY: Integer;
+ indX, indY, fX, fY, fSlope: Integer;
indW, indH: Word;
indA: Single;
a: TDFPoint;
if FAlive then
begin
FObj.lerp(gLerpFactor, fX, fY);
+ fSlope := nlerp(FSlopeOld, FObj.slopeUpLeft, gLerpFactor);
+
case gPlayerIndicatorStyle of
0:
begin
indY := fY - indH;
end;
+ indY := indY + fSlope;
indX := EnsureRange(indX, 0, Max(gMapInfo.Width, gPlayerScreenSize.X) - indW);
indY := EnsureRange(indY, 0, Max(gMapInfo.Height, gPlayerScreenSize.Y) - indH);
begin
e_TextureFontGetSize(gStdFont, nW, nH);
indX := fX + FObj.Rect.X + (FObj.Rect.Width - Length(FName) * nW) div 2;
- indY := fY - nH;
+ indY := fY - nH + fSlope;
e_TextureFontPrintEx(indX, indY, FName, gStdFont, Color.R, Color.G, Color.B, 1.0, True);
end;
end;
w, h: Word;
dr: Boolean;
Mirror: TMirrorType;
- fX, fY: Integer;
+ fX, fY, fSlope: Integer;
begin
FObj.lerp(gLerpFactor, fX, fY);
+ fSlope := nlerp(FSlopeOld, FObj.slopeUpLeft, gLerpFactor);
if FAlive then
begin
if FPunchAnim <> nil then
begin
FPunchAnim.Draw(fX+IfThen(Direction = TDirection.D_LEFT, 15-FObj.Rect.X, FObj.Rect.X-15),
- fY+FObj.Rect.Y-11, Mirror);
+ fY+fSlope+FObj.Rect.Y-11, Mirror);
if FPunchAnim.played then
begin
FPunchAnim.Free;
e_GetTextureSize(ID, @w, @h);
if FDirection = TDirection.D_LEFT then
e_Draw(ID, fX+FObj.Rect.X+(FObj.Rect.Width div 2)-(w div 2)+4,
- fY+FObj.Rect.Y+(FObj.Rect.Height div 2)-(h div 2)-7+FObj.slopeUpLeft, 0, True, False)
+ fY+FObj.Rect.Y+(FObj.Rect.Height div 2)-(h div 2)-7+fSlope, 0, True, False)
else
e_Draw(ID, fX+FObj.Rect.X+(FObj.Rect.Width div 2)-(w div 2)-2,
- fY+FObj.Rect.Y+(FObj.Rect.Height div 2)-(h div 2)-7+FObj.slopeUpLeft, 0, True, False);
+ fY+FObj.Rect.Y+(FObj.Rect.Height div 2)-(h div 2)-7+fSlope, 0, True, False);
end;
if FMegaRulez[MR_INVIS] > gTime then
else
dr := True;
if dr then
- FModel.Draw(fX, fY+FObj.slopeUpLeft, 200)
+ FModel.Draw(fX, fY+fSlope, 200)
else
- FModel.Draw(fX, fY+FObj.slopeUpLeft);
+ FModel.Draw(fX, fY+fSlope);
end
else
- FModel.Draw(fX, fY+FObj.slopeUpLeft, 254);
+ FModel.Draw(fX, fY+fSlope, 254);
end
else
- FModel.Draw(fX, fY+FObj.slopeUpLeft);
+ FModel.Draw(fX, fY+fSlope);
end;
if g_debug_Frames then
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;
ReleaseKeys();
FDamageBuffer := 0;
+ FSlopeOld := 0;
FIncCamOld := 0;
FIncCam := 0;
FBFGFireCounter := -1;
Anim: TAnimation;
ID: DWORD;
begin
+ FSlopeOld := 0;
FIncCamOld := 0;
FIncCam := 0;
FBFGFireCounter := -1;
procedure TPlayer.PreUpdate();
begin
+ FSlopeOld := FObj.slopeUpLeft;
FIncCamOld := FIncCam;
FObj.oldX := FObj.X;
FObj.oldY := FObj.Y;
NetServer := g_Game_IsNet and g_Game_IsServer;
AnyServer := g_Game_IsServer;
- if FGhost then
- DoLerp(4);
+ if g_Game_IsClient and (NetInterpLevel > 0) then
+ DoLerp(NetInterpLevel + 1)
+ else
+ if FGhost then
+ DoLerp(4);
if NetServer then
if FClientID >= 0 then
var
AX, AY: Integer;
begin
+ FXTo := XTo;
+ FYTo := YTo;
if NetInterpLevel < 1 then
begin
FObj.X := XTo;
end
else
begin
- FXTo := XTo;
- FYTo := YTo;
-
AX := Abs(FXTo - FObj.X);
AY := Abs(FYTo - FObj.Y);
if (AX > 32) or (AX <= NetInterpLevel) then