refactor: use squared distance if possible

refactor: add some const-correctness to code
This commit is contained in:
jeefo 2023-06-24 02:36:51 +03:00
commit 4a35a87b25
No known key found for this signature in database
GPG key ID: 927BCA0779BEA8ED
24 changed files with 579 additions and 567 deletions

View file

@ -76,7 +76,7 @@ void GraphAnalyze::update () {
setUpdateInterval ();
auto pos = graph[i].origin;
auto range = cv_graph_analyze_distance.float_ ();
const auto range = cv_graph_analyze_distance.float_ ();
for (int dir = 1; dir < kMaxNodeLinks; ++dir) {
switch (dir) {
@ -269,7 +269,7 @@ void GraphAnalyze::flood (const Vector &pos, const Vector &next, float range) {
game.testHull (pos, { next.x, next.y, next.z + 19.0f }, TraceIgnore::Monsters, head_hull, nullptr, &tr);
// we're can't reach next point
if (!cr::fequal (tr.flFraction, 1.0f) && !game.isShootableBreakable (tr.pHit)) {
if (!cr::fequal (tr.flFraction, 1.0f) && !util.isShootableBreakable (tr.pHit)) {
return;
}