Closed nosoop closed 5 years ago
Fixed one case with commit 72d93eb — it only attempts to change class if the server's expected desired class doesn't match.
One verified situation that a bot will spam weapon switches is if they can't switch weapons at the moment (e.g., if they are revved up on a minigun). This should probably be properly handled by a call to the game's weapon switch function, but I'm not sure what the best way of setting that up would be (depending on if the SDK provides it or if we have to get a game config for it).
Second issue lies within CBotTF2::select_CWeapon()
and CBotTF2::selectBotWeapon()
, which uses command dispatch to switch weapons.
m_pController->SetActiveWeapon()
is a no-go — it instantiates new instances of weapons. Handling it via usercmd seems like the way to go, but determining available weapons from the game doesn't seem trivial from what the SDK offers; a lot easier with sendprop support from SM.
This issue, combined with a low
sv_quota_stringcmdspersecond
value, kicks RCBots when they aren't expecting to be kicked, causing a crash.Bots keep trying to select a class on every think tick when they're dead.
Pretty sure
CBotTF2::handleWeapons
is also problematic as Snipers always switch between their primary and secondary weapons; still need to figure out why though.