From 02f4564442869ecc2e34b8eb5cbb1d114890b4ef Mon Sep 17 00:00:00 2001 From: Jorijn van der Graaf Date: Sun, 1 Nov 2026 18:24:35 +0100 Subject: [PATCH] fix(examples): restart ball ids when the scene is cleared World_Reset kept counting, so after one reset the ball dropped from 60 m was ball 10, not the ball 5 the plain build's output and the log from before the reset name. The agent in the first check noticed and worked around it. Clear now restarts ids at 1, so Reset brings back balls 1 to 5. Co-Authored-By: Claude Opus 5.5 --- examples/Basic/implementations/Basic.World.cpp | 1 + examples/Basic/interfaces/Basic.World.cppm | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/Basic/implementations/Basic.World.cpp b/examples/Basic/implementations/Basic.World.cpp index 14459f5..eb27403 100644 --- a/examples/Basic/implementations/Basic.World.cpp +++ b/examples/Basic/implementations/Basic.World.cpp @@ -16,6 +16,7 @@ void Basic::World::Reset() { void Basic::World::Clear() { balls.clear(); + nextId = 1; time = 0; fastest = 0; } diff --git a/examples/Basic/interfaces/Basic.World.cppm b/examples/Basic/interfaces/Basic.World.cppm index 3ec2b06..892f5c7 100644 --- a/examples/Basic/interfaces/Basic.World.cppm +++ b/examples/Basic/interfaces/Basic.World.cppm @@ -43,8 +43,9 @@ export namespace Basic { Physics physics; Floor floor; - // Removes every ball and drops the scene's five. + // Removes every ball and drops the scene's five, as balls 1 to 5. void Reset(); + // Removes every ball; ids start again from 1. void Clear(); // Returns the new ball's id. std::int32_t Spawn(float x, float y, float vy, float radius);