From f2ee0e404cd5c5a5587262d388c81c1107d72688 Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Sun, 28 Feb 2010 16:53:12 +0000 Subject: [PATCH] Detect slopes and warn they're not supported --- src/Editor.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Editor.cpp b/src/Editor.cpp index ef2388f..76056d4 100644 --- a/src/Editor.cpp +++ b/src/Editor.cpp @@ -237,8 +237,16 @@ bool Editor::drawTrackTile(const Point& aPoint, const track::Direction& anA Vector slope = map->slopeAt(aPoint, anAxis, level); if (level) { - map->setTrackAt(aPoint, makeStraightTrack(anAxis)); - return true; + const bool flat = abs(slope.y) < 0.001f; + + if (flat) { + map->setTrackAt(aPoint, makeStraightTrack(anAxis)); + return true; + } + else { + warn() << "Slopes not supported yet"; + return false; + } } else { warn() << "Track must be placed on level ground"; -- 2.39.2