From 0f9e890509cbefda8e937d6fc54249920dfd0094 Mon Sep 17 00:00:00 2001 From: jeefo Date: Fri, 19 Jan 2024 14:33:09 +0300 Subject: [PATCH] fix: graph info messages shown incorrectly while editing --- src/graph.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/graph.cpp b/src/graph.cpp index a41e207..e3a77ef 100644 --- a/src/graph.cpp +++ b/src/graph.cpp @@ -2056,7 +2056,7 @@ void BotGraph::frame () { } // draw a paths, camplines and danger directions for nearest node - if (nearestDistanceSq <= 56.0f && m_pathDisplayTime < game.time ()) { + if (nearestDistanceSq < cr::clamp (m_paths[nearestIndex].radius, cr::sqrf (56.0f), cr::sqrf (90.0f)) && m_pathDisplayTime < game.time ()) { m_pathDisplayTime = game.time () + 0.96f; // create path pointer for faster access @@ -2147,7 +2147,7 @@ void BotGraph::frame () { auto sendHudMessage = [&] (Color color, float x, float y, StringRef text) { static hudtextparms_t textParams {}; - textParams.channel = channel; + textParams.channel = channel++; textParams.x = x; textParams.y = y; textParams.effect = 0; @@ -2159,7 +2159,7 @@ void BotGraph::frame () { textParams.fadeinTime = 0.0f; textParams.fadeoutTime = 0.0f; - textParams.holdTime = m_pathDisplayTime; + textParams.holdTime = m_pathDisplayTime - game.time (); textParams.fxTime = 0.0f; game.sendHudMessage (m_editor, textParams, text);