fix: hide chatter icon even for players that changed team

fix: mark bot as finished buying on csdm spawn (ref #734)
fix: do not start any map analysis if already analyzing (ref #726)
combat: improved head/body aiming (ref #734)
This commit is contained in:
jeefo 2025-09-10 15:32:40 +03:00
commit 6604145481
No known key found for this signature in database
GPG key ID: D696786B81B667C8
6 changed files with 53 additions and 19 deletions

View file

@ -881,7 +881,9 @@ void Bot::showChatterIcon (bool show, bool disconnect) const {
// do not respect timers while disconnecting bot
for (auto &client : util.getClients ()) {
if (!(client.flags & ClientFlags::Used) || (client.ent->v.flags & FL_FAKECLIENT) || client.team != m_team) {
if (!(client.flags & ClientFlags::Used)
|| (client.ent->v.flags & FL_FAKECLIENT)
|| (client.team != m_team && !disconnect)) {
continue;
}
@ -891,7 +893,7 @@ void Bot::showChatterIcon (bool show, bool disconnect) const {
}
// do not respect timers while disconnecting bot
if (!show && (client.iconFlags[ownIndex] & ClientFlags::Icon) && (disconnect || client.iconTimestamp[ownIndex] < game.time ())) {
if (!show && (disconnect || (client.iconFlags[ownIndex] & ClientFlags::Icon)) && (disconnect || client.iconTimestamp[ownIndex] < game.time ())) {
sendBotVoice (false, client.ent, entindex ());
client.iconTimestamp[ownIndex] = 0.0f;
@ -1828,7 +1830,9 @@ void Bot::syncUpdatePredictedIndex () {
const float distToBotSq = botOrigin.distanceSq (graph[index].origin);
if (vistab.visible (currentNodeIndex, index) && distToBotSq < cr::sqrf (2048.0f)) {
if (vistab.visible (currentNodeIndex, index)
&& distToBotSq < cr::sqrf (2048.0f)
&& distToBotSq > cr::sqrf (128.0f)) {
bestIndex = index;
return false;
}
@ -3283,7 +3287,15 @@ void Bot::checkSpawnConditions () {
dropCurrentWeapon ();
}
else {
selectWeaponById (Weapon::Knife);
bool switchToKnife = true;
if (m_currentWeapon == Weapon::Scout) {
switchToKnife = rg.chance (25);
}
if (switchToKnife) {
selectWeaponById (Weapon::Knife);
}
}
}
m_checkKnifeSwitch = false;
@ -3474,6 +3486,8 @@ void Bot::spawned () {
if (game.is (GameFlags::CSDM | GameFlags::ZombieMod)) {
newRound ();
clearTasks ();
m_buyingFinished = true;
}
}