Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/game/server/tf/bot/behavior/tf_bot_seek_and_destroy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,15 @@ ActionResult< CTFBot > CTFBotSeekAndDestroy::Update( CTFBot *me, float interval
return Done( "The point just unlocked" );
}
}

if ( !TFGameRules()->RoundHasBeenWon() && me->GetTimeLeftToCapture() < tf_bot_offense_must_push_time.GetFloat() )

// Added proper fix to the bot offense push time bug that causes seek and destroy to never happen
// Basically just check for these gamemodes and otherwise allow seek and destroy at all times
if (TFGameRules()->GetGameType() == TF_GAMETYPE_ESCORT || TFGameRules()->GetGameType() == TF_GAMETYPE_CP)
{
return Done( "Time to push for the objective" );
if (!TFGameRules()->RoundHasBeenWon() && me->GetTimeLeftToCapture() < tf_bot_offense_must_push_time.GetFloat())
{
return Done("Time to push for the objective");
}
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/game/server/tf/bot/tf_bot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2286,7 +2286,8 @@ float CTFBot::GetTimeLeftToCapture( void ) const
return TFGameRules()->GetActiveRoundTimer()->GetTimeRemaining();
}

return 0.0f;
// Instead of returning 0.0, return FLT_MAX to prevent any other bugs related to this check.
return FLT_MAX;
}


Expand Down