bot: done some experiments with think timers

This commit is contained in:
jeefo 2025-08-23 16:24:13 +03:00
commit 90dde6690b
No known key found for this signature in database
GPG key ID: D696786B81B667C8
4 changed files with 32 additions and 26 deletions

View file

@ -1217,6 +1217,14 @@ void Bot::selectWeapons (float distance, int, int id, int choosen) {
}
}
void Bot::doFireWeapons () {
// the bots wants to fire at something?
if (m_shootAtDeadTime > game.time () || (m_wantsToFire && !m_isUsingGrenade && m_shootTime <= game.time ())) {
fireWeapons (); // if bot didn't fire a bullet try again next frame
}
}
void Bot::fireWeapons () {
// this function will return true if weapon was fired, false otherwise