diff --git a/src/d_protocol.cpp b/src/d_protocol.cpp index fe7b397a6..36bcefe1c 100644 --- a/src/d_protocol.cpp +++ b/src/d_protocol.cpp @@ -282,7 +282,10 @@ void ReadUserCmdMessage(TArrayView& stream, int player, int tic) Net_SkipCommand(type, stream); // Subtract a byte to account for the fact the stream head is now sitting on the - // user command. + // user command. This gets cleared first because it previously got cleared after + // executing but that breaks packet-server mode and I have no idea what side effects + // might happen if it's not wiped first. + curTic.Data.SetData(nullptr, 0u); curTic.Data.SetData(start, int(stream.Data() - start - 1)); if (type == DEM_USERCMD) @@ -311,9 +314,6 @@ void RunPlayerCommands(int player, int tic) { while (stream.Size() > 0) Net_DoCommand(ReadInt8(stream), stream, player); - - if (!demorecording) - data.SetData(nullptr, 0); } } diff --git a/src/g_game.cpp b/src/g_game.cpp index b0ac2ec21..2cc8e58d2 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -2573,12 +2573,8 @@ void G_WriteDemoTiccmd (usercmd_t *cmd, int player, int buf) // [RH] Write any special "ticcmds" for this player to the demo if ((specdata = ClientStates[player].Tics[buf % BACKUPTICS].Data.GetData (&speclen)) && !(gametic % TicDup)) - { WriteBytes(TArrayView(specdata, speclen), demo_p); - ClientStates[player].Tics[buf % BACKUPTICS].Data.SetData(nullptr, 0); - } - // [RH] Now write out a "normal" ticcmd. WriteUserCmdMessage (*cmd, &players[player].cmd, demo_p);