mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-08-12 07:32:24 +00:00
FixedBiomeSource: Make sure BiomeSource functions get overriden
Fixes a segfault when creating a superflat world
This commit is contained in:
parent
9748827f72
commit
60be363e8e
|
|
@ -200,7 +200,7 @@ TilePos* FixedBiomeSource::findBiome(int x, int z, int r, Biome* toFind,
|
||||||
* @brief Finds a biome from a list of allowed biomes randomly.
|
* @brief Finds a biome from a list of allowed biomes randomly.
|
||||||
*/
|
*/
|
||||||
TilePos* FixedBiomeSource::findBiome(int x, int z, int r,
|
TilePos* FixedBiomeSource::findBiome(int x, int z, int r,
|
||||||
const std::vector<Biome*>& allowed,
|
const std::vector<Biome*> allowed,
|
||||||
Random* random) {
|
Random* random) {
|
||||||
if (find(allowed.begin(), allowed.end(), biome) != allowed.end()) {
|
if (find(allowed.begin(), allowed.end(), biome) != allowed.end()) {
|
||||||
return new TilePos(x - r + random->nextInt(r * 2 + 1), 0,
|
return new TilePos(x - r + random->nextInt(r * 2 + 1), 0,
|
||||||
|
|
@ -220,6 +220,6 @@ bool FixedBiomeSource::containsOnly(int x, int z, int r, Biome* allowed) {
|
||||||
* @brief Checks if the fixed biome is in the allowed list.
|
* @brief Checks if the fixed biome is in the allowed list.
|
||||||
*/
|
*/
|
||||||
bool FixedBiomeSource::containsOnly(int x, int z, int r,
|
bool FixedBiomeSource::containsOnly(int x, int z, int r,
|
||||||
const std::vector<Biome*>& allowed) {
|
const std::vector<Biome*> allowed) {
|
||||||
return find(allowed.begin(), allowed.end(), biome) != allowed.end();
|
return find(allowed.begin(), allowed.end(), biome) != allowed.end();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,10 +36,10 @@ class FixedBiomeSource : public BiomeSource {
|
||||||
virtual TilePos* findBiome(int x, int z, int r, Biome* toFind,
|
virtual TilePos* findBiome(int x, int z, int r, Biome* toFind,
|
||||||
Random* random);
|
Random* random);
|
||||||
virtual TilePos* findBiome(int x, int z, int r,
|
virtual TilePos* findBiome(int x, int z, int r,
|
||||||
const std::vector<Biome*>& allowed,
|
const std::vector<Biome*> allowed,
|
||||||
Random* random);
|
Random* random);
|
||||||
virtual bool containsOnly(int x, int z, int r, Biome* allowed);
|
virtual bool containsOnly(int x, int z, int r, Biome* allowed);
|
||||||
virtual bool containsOnly(
|
virtual bool containsOnly(
|
||||||
int x, int z, int r,
|
int x, int z, int r,
|
||||||
const std::vector<Biome*>& allowed);
|
const std::vector<Biome*> allowed);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue