summaryrefslogtreecommitdiff
path: root/src/biome.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/biome.cpp')
-rw-r--r--src/biome.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/biome.cpp b/src/biome.cpp
index b50c562a0..bc84d4bc1 100644
--- a/src/biome.cpp
+++ b/src/biome.cpp
@@ -168,3 +168,13 @@ Biome *BiomeDefManager::getBiome(float heat, float humidity, s16 y) {
return biome_closest ? biome_closest : biomes[0];
}
+
+
+u8 BiomeDefManager::getBiomeIdByName(const char *name) {
+ for (size_t i = 0; i != biomes.size(); i++) {
+ if (!strcasecmp(name, biomes[i]->name.c_str()))
+ return i;
+ }
+
+ return 0;
+}