Skip to content

Commit 0a25cfa

Browse files
Implement upstream PR ValveSoftware#917 [Fix bots never using their Seek and Destroy]
Co-authored-by: ShowinGrowin <[email protected]>
1 parent 225a124 commit 0a25cfa

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/game/server/tf/bot/behavior/tf_bot_seek_and_destroy.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,14 @@ ActionResult< CTFBot > CTFBotSeekAndDestroy::Update( CTFBot *me, float interval
8383
}
8484
}
8585

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

src/game/server/tf/bot/tf_bot.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2286,7 +2286,8 @@ float CTFBot::GetTimeLeftToCapture( void ) const
22862286
return TFGameRules()->GetActiveRoundTimer()->GetTimeRemaining();
22872287
}
22882288

2289-
return 0.0f;
2289+
// Instead of returning 0.0, return FLT_MAX to prevent any other bugs related to this check.
2290+
return FLT_MAX;
22902291
}
22912292

22922293

0 commit comments

Comments
 (0)