From: terencehill Date: Fri, 28 Jul 2017 13:58:49 +0000 (+0200) Subject: Revert "Fix bots not jumping to get out of lava and water" not working as intended... X-Git-Tag: xonotic-v0.8.5~2378^2~112 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8a2fb7126b8d7847546deab9af1a80e3c0267bb1;p=xonotic%2Fxonotic-data.pk3dir.git Revert "Fix bots not jumping to get out of lava and water" not working as intended (this.waterlevel is always 0 in that code path). The later commit 68b0ed76e2 "Fix bots not jumping to get out of lava and water (part 2)" seems to be enough to fix this issue anyway This reverts commit 319bde143c8b475e16169121e9910bb98794e68f. --- diff --git a/qcsrc/server/bot/default/havocbot/havocbot.qc b/qcsrc/server/bot/default/havocbot/havocbot.qc index f0b229bae..68c3d6966 100644 --- a/qcsrc/server/bot/default/havocbot/havocbot.qc +++ b/qcsrc/server/bot/default/havocbot/havocbot.qc @@ -834,7 +834,6 @@ void havocbot_movetogoal(entity this) traceline(this.origin + this.view_ofs, dst_ahead, true, NULL); bool unreachable = false; - bool ignorehazards = false; s = CONTENT_SOLID; if(trace_fraction == 1 && this.jumppadcount == 0 && !this.goalcurrent.wphardwired ) if((IS_ONGROUND(this)) || (this.aistatus & AI_STATUS_RUNNING) || (this.aistatus & AI_STATUS_ROAMING) || PHYS_INPUT_BUTTON_JUMP(this)) @@ -848,16 +847,7 @@ void havocbot_movetogoal(entity this) s = pointcontents(trace_endpos + '0 0 1'); if (s != CONTENT_SOLID) if (s == CONTENT_LAVA || s == CONTENT_SLIME) - { evadelava = normalize(this.velocity) * -1; - if(this.waterlevel >= WATERLEVEL_WETFEET && (this.watertype == CONTENT_LAVA || this.watertype == CONTENT_SLIME)) - ignorehazards = true; - } - else if (s == CONTENT_WATER) - { - if(this.waterlevel >= WATERLEVEL_WETFEET && this.watertype == CONTENT_WATER) - ignorehazards = true; - } else if (s == CONTENT_SKY) evadeobstacle = normalize(this.velocity) * -1; else if (tracebox_hits_trigger_hurt(dst_ahead, this.mins, this.maxs, trace_endpos)) @@ -886,8 +876,7 @@ void havocbot_movetogoal(entity this) if(evadeobstacle || evadelava || (s == CONTENT_WATER)) { - if(!ignorehazards) - this.aistatus |= AI_STATUS_DANGER_AHEAD; + this.aistatus |= AI_STATUS_DANGER_AHEAD; if(IS_PLAYER(this.goalcurrent)) unreachable = true; }