From b4cd5f3db666b50c2fd02579bf30ca6417f273b9 Mon Sep 17 00:00:00 2001 From: terencehill Date: Thu, 21 Jun 2018 20:07:10 +0200 Subject: [PATCH] Bot AI: assume bot is walking if it's in the water but not swimming; it fixes issues when bot is really walking on flooded floors (e.g. can't jump obstacles up), it seems it works fine when bot is running / jumping on the water too --- qcsrc/server/bot/default/havocbot/havocbot.qc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/qcsrc/server/bot/default/havocbot/havocbot.qc b/qcsrc/server/bot/default/havocbot/havocbot.qc index c995ce8c8..ded58bf3f 100644 --- a/qcsrc/server/bot/default/havocbot/havocbot.qc +++ b/qcsrc/server/bot/default/havocbot/havocbot.qc @@ -891,9 +891,9 @@ void havocbot_movetogoal(entity this) this.aistatus &= ~AI_STATUS_DANGER_AHEAD; makevectors(this.v_angle.y * '0 1 0'); - if (this.waterlevel) + if (this.waterlevel > WATERLEVEL_WETFEET) { - if(this.waterlevel>WATERLEVEL_SWIMMING) + if (this.waterlevel > WATERLEVEL_SWIMMING) { if(!this.goalcurrent) this.aistatus |= AI_STATUS_OUT_WATER; @@ -904,7 +904,7 @@ void havocbot_movetogoal(entity this) { dir = flatdir; if(this.velocity.z >= 0 && !(this.watertype == CONTENT_WATER && destorg.z < this.origin.z) && - ( !(this.waterlevel == WATERLEVEL_WETFEET && this.watertype == CONTENT_WATER) || this.aistatus & AI_STATUS_OUT_WATER)) + (this.aistatus & AI_STATUS_OUT_WATER)) PHYS_INPUT_BUTTON_JUMP(this) = true; else PHYS_INPUT_BUTTON_JUMP(this) = false; @@ -1597,6 +1597,7 @@ void havocbot_setupbot(entity this) this.cmd_moveto = havocbot_moveto; this.cmd_resetgoal = havocbot_resetgoal; + // NOTE: bot is not player yet havocbot_chooserole(this); } -- 2.39.2