From e19b0856846bbdcc860c735b9da95082965f604b Mon Sep 17 00:00:00 2001
From: Shane Ellis <cobaltbw@gmail.com>
Date: Fri, 15 Jan 2021 22:56:48 -0500
Subject: [PATCH] Netcode failsafe. At least until I can figure out the best
 way to produce bot cmds outside of player sends.

---
 src/b_bot.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/b_bot.c b/src/b_bot.c
index d3635f32c5..35b14bd780 100644
--- a/src/b_bot.c
+++ b/src/b_bot.c
@@ -362,6 +362,12 @@ void B_BuildTiccmd(player_t *player, ticcmd_t *cmd)
 	// Bot AI isn't programmed in analog.
 	CV_SetValue(&cv_analog[1], false);
 
+	// Bot cmd functions and hooks are not currently netplay compatible
+	// Necessary failsafe, as a bot in the P2 position in a netgame can inherit
+	// the last input from a hook triggered in splitscreen or SP.
+	if (netgame)
+		return; 
+
 	// Let Lua scripts build ticcmds
 	if (LUAh_BotTiccmd(player, cmd))
 		return;
-- 
GitLab