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:
parent
5ce2032acd
commit
93d9187f6d
12 changed files with 205 additions and 182 deletions
|
|
@ -559,18 +559,6 @@ void BotSupport::installSendTo () {
|
|||
}
|
||||
}
|
||||
|
||||
bool BotSupport::isObjectInsidePlane (FrustumPlane &plane, const Vector ¢er, 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));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue