From fb96217147a12f635413f7ff31308104c2678844 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Tue, 17 Oct 2023 18:08:33 +0200 Subject: [PATCH] Fix first value in graphs being incorrect As the index was incremented before setting the value, the value at index 0 was not set correctly until the ringbuffer wraps around. --- src/engine/client/graph.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/client/graph.cpp b/src/engine/client/graph.cpp index c7e6e2762..1f68342a5 100644 --- a/src/engine/client/graph.cpp +++ b/src/engine/client/graph.cpp @@ -38,8 +38,8 @@ void CGraph::Scale() void CGraph::Add(float Value, ColorRGBA Color) { - m_Index = (m_Index + 1) % MAX_VALUES; InsertAt(m_Index, Value, Color); + m_Index = (m_Index + 1) % MAX_VALUES; } void CGraph::InsertAt(size_t Index, float Value, ColorRGBA Color)