Merge pull request #259 from TheComputerGuy96/fix/biomesource-override

FixedBiomeSource: Make sure BiomeSource functions get overriden
This commit is contained in:
ffqq 2026-03-16 14:45:33 +03:00 committed by GitHub
commit 7ddacfb850
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -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.
*/
TilePos* FixedBiomeSource::findBiome(int x, int z, int r,
const std::vector<Biome*>& allowed,
const std::vector<Biome*> allowed,
Random* random) {
if (find(allowed.begin(), allowed.end(), biome) != allowed.end()) {
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.
*/
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();
}

View file

@ -36,10 +36,10 @@ class FixedBiomeSource : public BiomeSource {
virtual TilePos* findBiome(int x, int z, int r, Biome* toFind,
Random* random);
virtual TilePos* findBiome(int x, int z, int r,
const std::vector<Biome*>& allowed,
const std::vector<Biome*> allowed,
Random* random);
virtual bool containsOnly(int x, int z, int r, Biome* allowed);
virtual bool containsOnly(
int x, int z, int r,
const std::vector<Biome*>& allowed);
const std::vector<Biome*> allowed);
};