From b4eeb90ce9b9d6b88c84d57727af8a5fa3d7e098 Mon Sep 17 00:00:00 2001 From: Maximilian Giller Date: Wed, 5 Jul 2023 15:21:45 +0200 Subject: [PATCH] Implemented handling for (usually) invalid state when creating ground --- src/game/physics/holes/ground/collectable_sim_ground.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/game/physics/holes/ground/collectable_sim_ground.cpp b/src/game/physics/holes/ground/collectable_sim_ground.cpp index b6d1a29..f7ae7f7 100644 --- a/src/game/physics/holes/ground/collectable_sim_ground.cpp +++ b/src/game/physics/holes/ground/collectable_sim_ground.cpp @@ -97,7 +97,8 @@ void CollectableSimGround::createSegment(float leftCorner, float rightCorner, { if (leftCorner > rightCorner) { - throw std::runtime_error("Left corner must be less than right corner"); + // Segment would have negative width, don't create it and leave empty instead + return; } if (segment == nullptr)