]> git.tdb.fi Git - r2c2.git/commitdiff
Properly round negative z coordinates for Terrain
authorMikko Rasa <tdb@tdb.fi>
Wed, 15 Apr 2015 09:23:05 +0000 (12:23 +0300)
committerMikko Rasa <tdb@tdb.fi>
Wed, 15 Apr 2015 09:23:05 +0000 (12:23 +0300)
source/libr2c2/terrain.cpp

index 002a536581a6201698baa2e45ab2870b8cd42cb3..ccfd912a2fd65e5e1048aa5c14b759fe7382bc3c 100644 (file)
@@ -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();
 }