From a078c21fb0b284ec455c04ded0bc85d339dd900b Mon Sep 17 00:00:00 2001 From: ohlidalp Date: Thu, 5 Dec 2024 04:31:47 +0100 Subject: [PATCH] example_ImGui_nodeHighlight.as: fixed out of bounds error --- resources/scripts/example_ImGui_nodeHighlight.as | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/resources/scripts/example_ImGui_nodeHighlight.as b/resources/scripts/example_ImGui_nodeHighlight.as index 0544a477a3..44c09a0c7a 100644 --- a/resources/scripts/example_ImGui_nodeHighlight.as +++ b/resources/scripts/example_ImGui_nodeHighlight.as @@ -27,7 +27,7 @@ void frameStep(float dt) if (ImGui::Begin("Example", closeBtnHandler.windowOpen, 0)) { closeBtnHandler.draw(); - + ImGui::TextDisabled("::: NODE HIGHLIGHT DEMO:::"); ImGui::Separator(); BeamClass@ actor = game.getCurrentTruck(); @@ -55,7 +55,7 @@ void frameStep(float dt) drawConfigUI(); } } - + ImGui::End(); } } @@ -178,6 +178,7 @@ void drawNodeHighlights(BeamClass@ actor) int mouseClosestNodeID = -1; int mouseClosestNodeDist = 999999; + nodeSelectedStates.resize(actor.getNodeCount()); ImDrawList@ drawlist = imgui_utils::ImGetDummyFullscreenWindow("nodeHighlights"); for (int i = 0; i < actor.getNodeCount(); i++)