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

@ -559,18 +559,6 @@ void BotSupport::installSendTo () {
}
}
bool BotSupport::isObjectInsidePlane (FrustumPlane &plane, const Vector &center, float height, float radius) {
auto isPointInsidePlane = [&] (const Vector &point) -> bool {
return plane.result + (plane.normal | point) >= 0.0f;
};
const Vector &test = plane.normal.get2d ();
const Vector &top = center + Vector (0.0f, 0.0f, height * 0.5f) + test * radius;
const Vector &bottom = center - Vector (0.0f, 0.0f, height * 0.5f) + test * radius;
return isPointInsidePlane (top) || isPointInsidePlane (bottom);
}
bool BotSupport::isModel (const edict_t *ent, StringRef model) {
return model.startsWith (ent->v.model.chars (9));
}