Skip to content

Commit 4637ec8

Browse files
committed
fix validation error
1 parent 07e6c19 commit 4637ec8

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/Backdash/Session/Backends/RemoteSession.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616

1717
namespace Backdash.Backends;
1818

19-
sealed class RemoteSession<TInput> : INetcodeSession<TInput>
20-
where TInput : unmanaged
19+
sealed class RemoteSession<TInput> : INetcodeSession<TInput> where TInput : unmanaged
2120
{
2221
readonly NetcodeOptions options;
2322
readonly Logger logger;

src/Backdash/Synchronizing/Input/InputQueue.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,17 +109,14 @@ public bool GetConfirmedInput(in Frame requestedFrame, ref GameInput<TInput> inp
109109

110110
public bool GetInput(in Frame requestedFrame, out GameInput<TInput> input)
111111
{
112-
if (inputs.IsEmpty)
113-
throw new InvalidOperationException("Can't get inputs: queue is empty.");
114-
115112
logger.Write(LogLevel.Trace, $"Queue {QueueId} => requesting input frame {requestedFrame.Number}.");
116113
// No one should ever try to grab any input when we have a prediction error.
117114
// Doing so means that we're just going further down the wrong path.
118115
ThrowIf.Assert(firstIncorrectFrame.IsNull);
119116
// Remember the last requested frame number for later. We'll need this in AddInput() to drop out of prediction mode.
120117
lastFrameRequested = requestedFrame;
121118
if (requestedFrame.Number < FirstInput.Frame.Number)
122-
throw new InvalidOperationException(
119+
throw new NetcodeAssertionException(
123120
$"Requested frame ({requestedFrame.Number}) can not be smaller than the first input frame ({FirstInput.Frame.Number})."
124121
);
125122

0 commit comments

Comments
 (0)