Bot AI: slightly improve underwater movement
authorterencehill <piuntn@gmail.com>
Wed, 21 Nov 2018 12:30:31 +0000 (13:30 +0100)
committerterencehill <piuntn@gmail.com>
Wed, 21 Nov 2018 12:30:31 +0000 (13:30 +0100)
qcsrc/server/bot/default/havocbot/havocbot.qc

index 0ebf5ac5068d7663f675bcc7018f6ca17d86f8b4..35b2cc4e28bcda0098b861056f22f0c50055031d 100644 (file)
@@ -929,12 +929,18 @@ void havocbot_movetogoal(entity this)
                        }
                        else
                        {
-                               dir = flatdir;
                                if(this.velocity.z >= 0 && !(this.watertype == CONTENT_WATER && destorg.z < this.origin.z) &&
                                        (this.aistatus & AI_STATUS_OUT_WATER))
+                               {
                                        PHYS_INPUT_BUTTON_JUMP(this) = true;
+                                       dir = flatdir;
+                               }
                                else
+                               {
                                        PHYS_INPUT_BUTTON_JUMP(this) = false;
+                                       if (destorg.z > this.origin.z)
+                                               dir = flatdir;
+                               }
                        }
                }
                else