From 21dac3e02b9c7b5ed93758e55dfa82b7cf4245d7 Mon Sep 17 00:00:00 2001 From: terencehill Date: Fri, 19 Jul 2019 15:29:56 +0200 Subject: [PATCH] Bot AI: fix bots occasionally jumping (dodging) when they shouldn't --- qcsrc/server/bot/default/havocbot/havocbot.qc | 12 +++++++++--- qcsrc/server/client.qc | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/qcsrc/server/bot/default/havocbot/havocbot.qc b/qcsrc/server/bot/default/havocbot/havocbot.qc index 6c056c27e..57b4c310e 100644 --- a/qcsrc/server/bot/default/havocbot/havocbot.qc +++ b/qcsrc/server/bot/default/havocbot/havocbot.qc @@ -1259,9 +1259,15 @@ void havocbot_movetogoal(entity this) if(skill+this.bot_moveskill >= autocvar_bot_ai_bunnyhop_skilloffset) havocbot_bunnyhop(this, dir); - if ((dir * v_up) >= autocvar_sv_jumpvelocity*0.5 && (IS_ONGROUND(this))) PHYS_INPUT_BUTTON_JUMP(this) = true; - if (((dodge * v_up) > 0) && random()*frametime >= 0.2*bound(0,(10-skill-this.bot_dodgeskill)*0.1,1)) PHYS_INPUT_BUTTON_JUMP(this) = true; - if (((dodge * v_up) < 0) && random()*frametime >= 0.5*bound(0,(10-skill-this.bot_dodgeskill)*0.1,1)) this.havocbot_ducktime=time+0.3/bound(0.1,skill+this.bot_dodgeskill,10); + if (dir * v_up >= autocvar_sv_jumpvelocity * 0.5 && IS_ONGROUND(this)) + PHYS_INPUT_BUTTON_JUMP(this) = true; + if (dodge) + { + if (dodge * v_up > 0 && random() * frametime >= 0.2 * bound(0, (10 - skill - this.bot_dodgeskill) * 0.1, 1)) + PHYS_INPUT_BUTTON_JUMP(this) = true; + if (dodge * v_up < 0 && random() * frametime >= 0.5 * bound(0, (10 - skill - this.bot_dodgeskill) * 0.1, 1)) + this.havocbot_ducktime = time + 0.3 / bound(0.1, skill + this.bot_dodgeskill, 10); + } } entity havocbot_gettarget(entity this, bool secondary) diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 8261f36b3..639717a90 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -2047,7 +2047,7 @@ void PrintWelcomeMessage(entity this) CS(this).motd_actived_time = -2; // wait until BUTTON_INFO gets released else if(CS(this).motd_actived_time == -2 || IS_PLAYER(this) || IS_SPEC(this)) { - // instanctly hide MOTD + // instantly hide MOTD CS(this).motd_actived_time = 0; Kill_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CPID_MOTD); } -- 2.39.2