From: Mikko Rasa Date: Fri, 22 Nov 2013 12:43:24 +0000 (+0200) Subject: Properly round negative elevations X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=d6816c177ee8d5f5191e833dce8e3c4e7e0222bf;p=r2c2.git Properly round negative elevations --- diff --git a/source/libr2c2/terrain.cpp b/source/libr2c2/terrain.cpp index e012bc9..c89d0f8 100644 --- a/source/libr2c2/terrain.cpp +++ b/source/libr2c2/terrain.cpp @@ -1,3 +1,4 @@ +#include #include #include #include "layout.h" @@ -83,7 +84,7 @@ void Terrain::set_node_elevation(const NodeCoordinates &c, float elev, bool join throw out_of_range("Terrain::set_node_elevation"); float eg = type.get_elevation_granularity(); - elev = int(elev/eg+0.5)*eg; + elev = floor(elev/eg+0.5)*eg; if(joined) {