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:
parent
b083e872e0
commit
6604145481
6 changed files with 53 additions and 19 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue