fix: crash on predicted node index use after wiped

refactor: reworked prediction to calc prediction for all bots at one job, instead of firing it for every bot
This commit is contained in:
jeefo 2023-06-29 20:17:46 +03:00
commit 93d9187f6d
No known key found for this signature in database
GPG key ID: 927BCA0779BEA8ED
12 changed files with 205 additions and 182 deletions

View file

@ -212,7 +212,7 @@ bool Bot::seesEnemy (edict_t *player) {
return false;
}
if (isEnemyInFrustum (player) && isInViewCone (player->v.origin) && checkBodyParts (player)) {
if (isInViewCone (player->v.origin) && frustum.check (m_viewFrustum, player) && checkBodyParts (player)) {
m_seeEnemyTime = game.time ();
m_lastEnemy = player;
m_lastEnemyOrigin = m_enemyOrigin;
@ -277,7 +277,7 @@ bool Bot::lookupEnemies () {
}
// check the engine PVS
if (!isEnemyInFrustum (interesting) || !game.checkVisibility (interesting, set)) {
if (!frustum.check (m_viewFrustum, interesting) || !game.checkVisibility (interesting, set)) {
continue;
}
@ -303,7 +303,7 @@ bool Bot::lookupEnemies () {
player = client.ent;
// check the engine PVS
if (!isEnemyInFrustum (player) || !game.checkVisibility (player, set)) {
if (!frustum.check (m_viewFrustum, player) || !game.checkVisibility (player, set)) {
continue;
}