summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-02-18 13:44:40 +0100
committermadmaxoft <github@xoft.cz>2014-02-18 13:49:24 +0100
commitb1c6b4f5843d1f466cd12dd159bc717ae46059b5 (patch)
tree0f5b3e119ff6f8af5c21b0e026bb179401988c1d
parentDebuggers: Added a test for the cWorld:SetAreaBiome() function. (diff)
downloadcuberite-b1c6b4f5843d1f466cd12dd159bc717ae46059b5.tar
cuberite-b1c6b4f5843d1f466cd12dd159bc717ae46059b5.tar.gz
cuberite-b1c6b4f5843d1f466cd12dd159bc717ae46059b5.tar.bz2
cuberite-b1c6b4f5843d1f466cd12dd159bc717ae46059b5.tar.lz
cuberite-b1c6b4f5843d1f466cd12dd159bc717ae46059b5.tar.xz
cuberite-b1c6b4f5843d1f466cd12dd159bc717ae46059b5.tar.zst
cuberite-b1c6b4f5843d1f466cd12dd159bc717ae46059b5.zip
-rw-r--r--src/World.cpp6
-rw-r--r--src/World.h3
2 files changed, 7 insertions, 2 deletions
diff --git a/src/World.cpp b/src/World.cpp
index c9d7f42be..e57675c44 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -1507,7 +1507,11 @@ bool cWorld::SetAreaBiome(int a_MinX, int a_MaxX, int a_MinZ, int a_MaxZ, EMCSBi
bool cWorld::SetAreaBiome(const cCuboid & a_Area, EMCSBiome a_Biome)
{
- return SetAreaBiome(a_Area.p1.x, a_Area.p2.x, a_Area.p1.z, a_Area.p2.z, a_Biome);
+ return SetAreaBiome(
+ std::min(a_Area.p1.x, a_Area.p2.x), std::max(a_Area.p1.x, a_Area.p2.x),
+ std::min(a_Area.p1.z, a_Area.p2.z), std::max(a_Area.p1.z, a_Area.p2.z),
+ a_Biome
+ );
}
diff --git a/src/World.h b/src/World.h
index dc286598c..d79de3b87 100644
--- a/src/World.h
+++ b/src/World.h
@@ -565,7 +565,8 @@ public:
bool SetAreaBiome(int a_MinX, int a_MaxX, int a_MinZ, int a_MaxZ, EMCSBiome a_Biome);
/** Sets the biome at the area. Returns true if successful, false if any subarea failed (chunk not loaded).
- (Re)sends the chunks to their relevant clients if successful. */
+ (Re)sends the chunks to their relevant clients if successful.
+ The cuboid needn't be sorted. */
bool SetAreaBiome(const cCuboid & a_Area, EMCSBiome a_Biome);
/** Returns the name of the world */