summaryrefslogtreecommitdiffstats
path: root/source/BioGen.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-07-29 18:44:47 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-07-29 18:44:47 +0200
commitf4bf4355288da77852d10bd8426bb4ca8ea99ba6 (patch)
tree36e131c7be673aa40e9963a2f63aca93880d7cff /source/BioGen.cpp
parentFixed *nix compilation for md5.cpp (diff)
downloadcuberite-f4bf4355288da77852d10bd8426bb4ca8ea99ba6.tar
cuberite-f4bf4355288da77852d10bd8426bb4ca8ea99ba6.tar.gz
cuberite-f4bf4355288da77852d10bd8426bb4ca8ea99ba6.tar.bz2
cuberite-f4bf4355288da77852d10bd8426bb4ca8ea99ba6.tar.lz
cuberite-f4bf4355288da77852d10bd8426bb4ca8ea99ba6.tar.xz
cuberite-f4bf4355288da77852d10bd8426bb4ca8ea99ba6.tar.zst
cuberite-f4bf4355288da77852d10bd8426bb4ca8ea99ba6.zip
Diffstat (limited to '')
-rw-r--r--source/BioGen.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/BioGen.cpp b/source/BioGen.cpp
index 8603a7452..73529abb6 100644
--- a/source/BioGen.cpp
+++ b/source/BioGen.cpp
@@ -223,7 +223,7 @@ EMCSBiome cBioGenVoronoi::VoronoiBiome(int a_BlockX, int a_BlockZ)
// Note that Noise values need to be divided by 8 to gain a uniform modulo-2^n distribution
// Get 5x5 neighboring cell seeds, compare distance to each. Return the biome in the minumim-distance cell
- double MinDist = m_CellSize * m_CellSize; // There has to be a cell closer than this
+ int MinDist = m_CellSize * m_CellSize * 16; // There has to be a cell closer than this
EMCSBiome res = biPlains; // Will be overriden
for (int x = CellX - 2; x <= CellX + 2; x++)
{
@@ -235,7 +235,7 @@ EMCSBiome cBioGenVoronoi::VoronoiBiome(int a_BlockX, int a_BlockZ)
int SeedX = BaseX + OffsetX;
int SeedZ = z * m_CellSize + OffsetZ;
- double Dist = sqrt((double)((SeedX - a_BlockX) * (SeedX - a_BlockX) + (SeedZ - a_BlockZ) * (SeedZ - a_BlockZ)));
+ int Dist = (SeedX - a_BlockX) * (SeedX - a_BlockX) + (SeedZ - a_BlockZ) * (SeedZ - a_BlockZ);
if (Dist < MinDist)
{
MinDist = Dist;