diff --git a/src/netcode/net_command.c b/src/netcode/net_command.c
index 13477d42d55950824b83b51614ffe7319d5fb92c..227b786605bae9e616d579c039e25be38efe9dce 100644
--- a/src/netcode/net_command.c
+++ b/src/netcode/net_command.c
@@ -304,6 +304,26 @@ void PT_TextCmd(SINT8 node, INT32 netconsole)
 	}
 }
 
+void SV_CopyNetCommandsToServerPacket(tic_t tic)
+{
+	servertics_pak *packet = &netbuffer->u.serverpak;
+	UINT8 *cmds = (UINT8*)&packet->cmds[packet->numslots * packet->numtics];
+	UINT8 numcmds;
+
+	numcmds = *cmds++;
+
+	for (UINT32 i = 0; i < numcmds; i++)
+	{
+		INT32 playernum = *cmds++; // playernum
+		size_t size = cmds[0]+1;
+
+		if (tic >= gametic) // Don't copy old net commands
+			M_Memcpy(D_GetTextcmd(tic, playernum), cmds, size);
+		cmds += size;
+	}
+}
+
+void CL_SendNetCommands(void)
 void SendKick(UINT8 playernum, UINT8 msg)
 {
 	UINT8 buf[2];
diff --git a/src/netcode/net_command.h b/src/netcode/net_command.h
index f1b4b2f3f84a5078a93868514094d4880a1b0115..a9447ed7a12ab8b7886ecf5d6b92af979d74a640 100644
--- a/src/netcode/net_command.h
+++ b/src/netcode/net_command.h
@@ -57,6 +57,7 @@ void ExtraDataTicker(void);
 size_t TotalTextCmdPerTic(tic_t tic);
 
 void PT_TextCmd(SINT8 node, INT32 netconsole);
+void SV_CopyNetCommandsToServerPacket(tic_t tic);
 void SendKick(UINT8 playernum, UINT8 msg);
 void SendKicksForNode(SINT8 node, UINT8 msg);
 
diff --git a/src/netcode/tic_command.c b/src/netcode/tic_command.c
index 417a2fdfdf4724e1220c662c287eec23d7167645..2eb3b10aca111d4500da53c2e2f37f81901e109c 100644
--- a/src/netcode/tic_command.c
+++ b/src/netcode/tic_command.c
@@ -204,7 +204,6 @@ void PT_ClientCmd(SINT8 node, INT32 netconsole)
 
 void PT_ServerTics(SINT8 node, INT32 netconsole)
 {
-	UINT8 *pak, *txtpak, numtxtpak;
 	tic_t realend, realstart;
 
 	if (!netnodes[node].ingame)
@@ -230,19 +229,15 @@ void PT_ServerTics(SINT8 node, INT32 netconsole)
 	realstart = netbuffer->u.serverpak.starttic;
 	realend = realstart + netbuffer->u.serverpak.numtics;
 
-	txtpak = (UINT8 *)&netbuffer->u.serverpak.cmds[netbuffer->u.serverpak.numslots
-		* netbuffer->u.serverpak.numtics];
-
 	if (realend > gametic + CLIENTBACKUPTICS)
 		realend = gametic + CLIENTBACKUPTICS;
 	cl_packetmissed = realstart > neededtic;
 
 	if (realstart <= neededtic && realend > neededtic)
 	{
-		tic_t i, j;
-		pak = (UINT8 *)&netbuffer->u.serverpak.cmds;
+		UINT8 *pak = (UINT8 *)&netbuffer->u.serverpak.cmds;
 
-		for (i = realstart; i < realend; i++)
+		for (tic_t i = realstart; i < realend; i++)
 		{
 			// clear first
 			D_Clearticcmd(i);
@@ -251,17 +246,7 @@ void PT_ServerTics(SINT8 node, INT32 netconsole)
 			pak = G_ScpyTiccmd(netcmds[i%BACKUPTICS], pak,
 				netbuffer->u.serverpak.numslots*sizeof (ticcmd_t));
 
-			// copy the textcmds
-			numtxtpak = *txtpak++;
-			for (j = 0; j < numtxtpak; j++)
-			{
-				INT32 k = *txtpak++; // playernum
-				const size_t txtsize = txtpak[0]+1;
-
-				if (i >= gametic) // Don't copy old net commands
-					M_Memcpy(D_GetTextcmd(i, k), txtpak, txtsize);
-				txtpak += txtsize;
-			}
+			SV_CopyNetCommandsToServerPacket(i);
 		}
 
 		neededtic = realend;