Skip to content

tf2: Fix MvM bots not being able to use their items #1365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Mikusch
Copy link

@Mikusch Mikusch commented Jun 21, 2025

In some cases, robots in MvM mode can not use their items (Buff Banner, Bonk, etc.), due to the timer in CTFBotUseItem ending before the weapon is fully deployed. This leads to a loop of robots constantly switching to their items without activating it.

We should wait until the bot is actually able to "attack" aka use the item.

Resubmission of #875 due to a deleted fork

@KaelaSavia
Copy link

KaelaSavia commented Jun 21, 2025

This will affect balance of Mann Up/Boot Camp heavily, I'd recommend making it convar that is turn-onable for community servers instead

@Mikusch
Copy link
Author

Mikusch commented Jun 21, 2025

This is fixing broken behavior introduced in Gun Mettle, due to the increased switch speed. I do not see how this affects the balance.

@@ -47,9 +47,12 @@ ActionResult< CTFBot > CTFBotUseItem::Update( CTFBot *me, float interval )
{
if ( m_cooldownTimer.IsElapsed() )
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is a bit of format nitpicking, but the if statements can be combined into one like so.

Suggested change
if ( m_cooldownTimer.IsElapsed() )
if ( m_cooldownTimer.IsElapsed() && me->GetNextAttack() <= gpGlobals->curtime )

@KimmyTF2
Copy link

This will affect balance of Mann Up/Boot Camp heavily, I'd recommend making it convar that is turn-onable for community servers instead

What? This is a bug messing with the gameplay. How is that related to balance in any way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants