summaryrefslogtreecommitdiffstats
path: root/src/graphics/engine
diff options
context:
space:
mode:
Diffstat (limited to 'src/graphics/engine')
-rw-r--r--src/graphics/engine/terrain.cpp12
-rw-r--r--src/graphics/engine/terrain.h2
2 files changed, 7 insertions, 7 deletions
diff --git a/src/graphics/engine/terrain.cpp b/src/graphics/engine/terrain.cpp
index d70ba0c..d2ddecc 100644
--- a/src/graphics/engine/terrain.cpp
+++ b/src/graphics/engine/terrain.cpp
@@ -1716,22 +1716,22 @@ float CTerrain::GetFlatZoneRadius(Math::Vector center, float max)
return 0.0f;
float ref = GetFloorLevel(center, true);
-
+ Math::Point c(center.x, center.z);
float radius = 1.0f;
+
while (radius <= max)
{
angle = 0.0f;
int nb = static_cast<int>(2.0f*Math::PI*radius);
if (nb < 8) nb = 8;
+ Math::Point p (center.x+radius, center.z);
for (int i = 0; i < nb; i++)
{
- Math::Point c(center.x, center.z);
- Math::Point p (center.x+radius, center.z);
- p = Math::RotatePoint(c, angle, p);
+ Math::Point result = Math::RotatePoint(c, angle, p);
Math::Vector pos;
- pos.x = p.x;
- pos.z = p.y;
+ pos.x = result.x;
+ pos.z = result.y;
float h = GetFloorLevel(pos, true);
if ( fabs(h-ref) > 1.0f ) return radius;
diff --git a/src/graphics/engine/terrain.h b/src/graphics/engine/terrain.h
index b83bfc8..3012e62 100644
--- a/src/graphics/engine/terrain.h
+++ b/src/graphics/engine/terrain.h
@@ -37,7 +37,7 @@ class CWater;
//! Limit of slope considered a flat piece of land
-const short TERRAIN_FLATLIMIT = (5.0f*Math::PI/180.0f);
+const float TERRAIN_FLATLIMIT = (5.0f*Math::PI/180.0f);
/**