Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Game.Client/C_BasePlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ public partial class C_BasePlayer : C_BaseCombatCharacter, IGameEventListener2

public override ShadowType ShadowCastType() => ShadowType.None;

static readonly DynamicAccessor DA_ViewOffset = FIELD.OF(nameof(ViewOffset));
public readonly InterpolatedVar<Vector3> IV_ViewOffset = new($"{nameof(C_BasePlayer)}.{nameof(IV_ViewOffset)}");

public C_BasePlayer() {
AddVar(this, DA_ViewOffset, IV_ViewOffset, LatchFlags.LatchSimulationVar, true);
}

public static readonly DataMap PM_PlayerState = new(typeof(PlayerState), [
DEFINE<PlayerState>.PRED_FIELD( nameof(PlayerState.DeadFlag), FieldType.Boolean, FieldTypeDescFlags.InSendTable ),
]);
Expand Down
3 changes: 2 additions & 1 deletion Source.Engine/CL.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ public void Move(double accumulatedExtraSamples, bool finalTick) {

bool sendPacket = true;

if (Net.Time < cl.NextCmdTime || !cl.NetChannel!.CanPacket())
if ((!cl.NetChannel!.IsLoopback() || Host.host_limitlocal.GetInt() != 0) &&
(Net.Time < cl.NextCmdTime || !cl.NetChannel!.CanPacket() || !finalTick))
sendPacket = false;

if (cl.IsActive()) {
Expand Down
1 change: 1 addition & 0 deletions Source.Engine/Host.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public partial class Host
public static readonly ConVar host_map = new("host_map", "", 0, "Current map name.");
public static readonly ConVar developer = new("developer", "0", 0, "Set developer message level");
public static readonly ConVar host_timescale = new("host_timescale", "1.0", FCvar.Replicated, "Prescale the clock by this amount.");
public static readonly ConVar host_limitlocal = new("host_limitlocal", "0", 0, "Apply cl_cmdrate and cl_updaterate to loopback connection");

#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.
public static GameClient? Client;
Expand Down
Loading