Implemented handling for (usually) invalid state when creating ground
This commit is contained in:
parent
762b163655
commit
b4eeb90ce9
1 changed files with 2 additions and 1 deletions
|
@ -97,7 +97,8 @@ void CollectableSimGround::createSegment(float leftCorner, float rightCorner,
|
||||||
{
|
{
|
||||||
if (leftCorner > 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)
|
if (segment == nullptr)
|
||||||
|
|
Loading…
Reference in a new issue