]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix regression caused by the previous commit where bots don't respawn
authorterencehill <piuntn@gmail.com>
Fri, 26 Mar 2021 16:45:13 +0000 (17:45 +0100)
committerterencehill <piuntn@gmail.com>
Fri, 26 Mar 2021 16:45:13 +0000 (17:45 +0100)
qcsrc/server/bot/default/bot.qc

index b9d468fbf1002e07cd53b6cd102cab9eb67be3c7..59ff81df94678b5f744c0da45e617019e56416a7 100644 (file)
@@ -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)