From: terencehill Date: Thu, 21 Jun 2018 18:07:10 +0000 (+0200) Subject: Bot AI: assume bot is walking if it's in the water but not swimming; it fixes issues... X-Git-Tag: xonotic-v0.8.5~1923^2~24 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b4cd5f3db666b50c2fd02579bf30ca6417f273b9;p=xonotic%2Fxonotic-data.pk3dir.git 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 --- 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); }