From 68049a125cf7c4680ef38d80eb1fb744349a6f34 Mon Sep 17 00:00:00 2001 From: terencehill Date: Fri, 26 Mar 2021 17:45:13 +0100 Subject: [PATCH] Fix regression caused by the previous commit where bots don't respawn --- qcsrc/server/bot/default/bot.qc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qcsrc/server/bot/default/bot.qc b/qcsrc/server/bot/default/bot.qc index b9d468fbf..59ff81df9 100644 --- a/qcsrc/server/bot/default/bot.qc +++ b/qcsrc/server/bot/default/bot.qc @@ -123,9 +123,14 @@ void bot_think(entity this) return; if (IS_DEAD(this)) { - PHYS_INPUT_BUTTON_JUMP(this) = true; // press jump to respawn if (!navigation_goalrating_timeout(this)) navigation_goalrating_timeout_force(this); + // jump must not be pressed for at least one frame in order for + // PlayerThink to detect the key down event + if (this.deadflag == DEAD_DYING) + PHYS_INPUT_BUTTON_JUMP(this) = false; + else if (this.deadflag == DEAD_DEAD) + PHYS_INPUT_BUTTON_JUMP(this) = true; // press jump to respawn } } else if(this.aistatus & AI_STATUS_STUCK) -- 2.39.2