reduced the follow params a bit and made sure to not follow nosteamers

This commit is contained in:
jenz 2026-07-14 19:09:04 +02:00
parent 07d344e730
commit 31ed5c6f72

View File

@ -41,19 +41,19 @@ int g_FrameCount[MAXPLAYERS+1]; // total frames captured, indexed by REAL client
#define BOT_STATE_APPROACH 1
#define BOT_STATE_MIMIC 2
#define ARRIVE_RADIUS 72.0 // horizontal distance to anchor that counts as "arrived"
#define ARRIVE_Z_SLACK 128.0 // max height difference to anchor that still counts as "arrived"
#define ARRIVE_RADIUS 18.0 // horizontal distance to anchor that counts as "arrived"
#define ARRIVE_Z_SLACK 256.0 // max height difference to anchor that still counts as "arrived"
#define APPROACH_SPEED 250.0 // forward move value while walking to the anchor
// Must stay comfortably bigger than ARRIVE_RADIUS or the bot can flap
// between MIMIC and APPROACH right at the boundary.
#define DESYNC_RADIUS 250.0 // if actual pos strays this far from the frame its about to play, resync
#define DESYNC_RADIUS 64.0 // if actual pos strays this far from the frame its about to play, resync
// Anti-loop / anti-stuck tuning
#define RESYNC_COOLDOWN 3.0 // min seconds between two resyncs; drift during cooldown just keeps mimicking
#define MAX_RESYNC_STRIKES 3 // this many resyncs on the same target -> give up, pick a new target
#define STUCK_CHECK_INTERVAL 4.0 // seconds between stuck checks while approaching
#define STUCK_MOVE_EPSILON 50.0 // if the bot moved less than this between checks, it counts as stuck
#define MAX_RESYNC_STRIKES 2 // this many resyncs on the same target -> give up, pick a new target
#define STUCK_CHECK_INTERVAL 1.0 // seconds between stuck checks while approaching
#define STUCK_MOVE_EPSILON 30.0 // if the bot moved less than this between checks, it counts as stuck
#define MAX_STUCK_STRIKES 2 // first strike re-anchors + jumps, second strike drops the target
int g_BotState[MAXPLAYERS+1]; // indexed by BOT client
@ -301,13 +301,6 @@ void ApplyApproachMovement(int bot, const float anchor[3], int &buttons, int &im
}
}
// Directly sets the bots active weapon to match the category the target is
// holding. Fixed slot layout: category 1-4 maps straight to raw inventory
// slot 0-3 (primary, secondary, knife, HE grenade). Uses smlibs
// Client_SetActiveWeapon, which manipulates the weapon state via SDK calls
// rather than a queued client command - this is why it can be called
// synchronously from inside OnPlayerRunCmd without the reentrancy problems
// a FakeClientCommandEx("slotN") had.
void SyncWeaponSlot(int bot, int wantSlot)
{
if (wantSlot == 0 || wantSlot == g_LastWeaponSlot[bot])
@ -985,7 +978,7 @@ public int GetClosestClient_option1(int autism_client)
{
if (IsValidClient(i) && !IsFakeClient(i) && IsPlayerAlive(i) && i != autism_client)
{
if (GetClientIdleTime(i) > 3 || GetClientTeam(autism_client) != GetClientTeam(i))
if (GetClientIdleTime(i) > 3 || GetClientTeam(autism_client) != GetClientTeam(i) || !PM_IsPlayerSteam(i)) //not following nosteamers is a bit quality check
{
continue;
}
@ -1125,4 +1118,3 @@ public Action TimerConnect(Handle timer, any arg)
connect_socket();
return Plugin_Handled;
}