diff --git a/Minecraft.World/Stats/Achievement.cpp b/Minecraft.World/Stats/Achievement.cpp index dd25cd342..b690b682b 100644 --- a/Minecraft.World/Stats/Achievement.cpp +++ b/Minecraft.World/Stats/Achievement.cpp @@ -1,9 +1,9 @@ +#include "../Platform/stdafx.h" #include "../Headers/net.minecraft.locale.h" #include "../Items/ItemInstance.h" -#include "../Platform/stdafx.h" +#include "Achievements.h" #include "../Util/DescFormatter.h" #include "Achievement.h" -#include "Achievements.h" /** * @brief Performs internal initialization for the achievement. diff --git a/Minecraft.World/WorldGen/Biomes/FixedBiomeSource.cpp b/Minecraft.World/WorldGen/Biomes/FixedBiomeSource.cpp index 4211537a1..cebeea73d 100644 --- a/Minecraft.World/WorldGen/Biomes/FixedBiomeSource.cpp +++ b/Minecraft.World/WorldGen/Biomes/FixedBiomeSource.cpp @@ -99,13 +99,12 @@ void FixedBiomeSource::getTemperatureBlock(doubleArray& temperatures, int x, */ void FixedBiomeSource::getDownfallBlock(floatArray& downfalls, int x, int z, int w, int h) const { - if (!downfalls.data || downfalls.length < w * h) { - if (downfalls.data) delete[] downfalls.data; + if (downfalls.data == NULL || downfalls.length < w * h) { + if (downfalls.data != NULL) delete[] downfalls.data; downfalls = floatArray(w * h); } Arrays::fill(downfalls, 0, w * h, downfall); } - /** * @brief Returns a floatArray filled with downfall values. */ @@ -124,7 +123,7 @@ float FixedBiomeSource::getDownfall(int x, int z) const { return downfall; } /** * @brief Fills a double array with downfall values. */ -void FixedBiomeSource::getDownfallBlock(doubleArray downfalls, int x, int z, +void FixedBiomeSource::getDownfallBlock(doubleArray& downfalls, int x, int z, int w, int h) { if (!downfalls.data || downfalls.length < w * h) { if (downfalls.data) delete[] downfalls.data; diff --git a/Minecraft.World/WorldGen/Biomes/FixedBiomeSource.h b/Minecraft.World/WorldGen/Biomes/FixedBiomeSource.h index 4148e3b2e..fea35d8dc 100644 --- a/Minecraft.World/WorldGen/Biomes/FixedBiomeSource.h +++ b/Minecraft.World/WorldGen/Biomes/FixedBiomeSource.h @@ -1,16 +1,16 @@ #pragma once +#include + #include "BiomeSource.h" class FixedBiomeSource : public BiomeSource { -private: + private: Biome* biome; float temperature, downfall; -public: + public: using BiomeSource::getTemperature; - FixedBiomeSource(Biome* fixed, float temperature, float downfall); - virtual Biome* getBiome(ChunkPos* cp); virtual Biome* getBiome(int x, int z); virtual float getTemperature(int x, int z); @@ -23,23 +23,23 @@ public: int h) const; virtual floatArray getDownfallBlock(int x, int z, int w, int h) const; virtual float getDownfall(int x, int z) const; - virtual void getDownfallBlock(doubleArray downfalls, int x, int z, int w, + virtual void getDownfallBlock(doubleArray& downfalls, int x, int z, int w, int h); virtual void getBiomeBlock(BiomeArray& biomes, int x, int z, int w, int h, bool useCache) const; virtual void getBiomeIndexBlock(byteArray& biomeIndices, int x, int z, int w, int h, bool useCache) const; - // 4J-PB added in from beyond 1.8.2 virtual BiomeArray getRawBiomeBlock(int x, int z, int w, int h) const; virtual void getRawBiomeBlock(BiomeArray& biomes, int x, int z, int w, int h) const; - - //////////////////////////////////// virtual TilePos* findBiome(int x, int z, int r, Biome* toFind, Random* random); - virtual TilePos* findBiome(int x, int z, int r, std::vector allowed, + virtual TilePos* findBiome(int x, int z, int r, + const std::vector& allowed, Random* random); virtual bool containsOnly(int x, int z, int r, Biome* allowed); - virtual bool containsOnly(int x, int z, int r, std::vector allowed); + virtual bool containsOnly( + int x, int z, int r, + const std::vector& allowed); };