From: Mikko Rasa Date: Wed, 15 Apr 2015 09:23:05 +0000 (+0300) Subject: Properly round negative z coordinates for Terrain X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=f7ab597d035a053311c1a8c5baa51b090262f045;p=r2c2.git Properly round negative z coordinates for Terrain --- diff --git a/source/libr2c2/terrain.cpp b/source/libr2c2/terrain.cpp index 002a536..ccfd912 100644 --- a/source/libr2c2/terrain.cpp +++ b/source/libr2c2/terrain.cpp @@ -39,7 +39,7 @@ void Terrain::set_position(const Vector &p) { position = p; float eg = type.get_elevation_granularity(); - position.z = int(position.z/eg+0.5)*eg; + position.z = round(position.z/eg)*eg; signal_moved.emit(); }