Skip to content

Commit

Permalink
Fixed crash on unknown biome.
Browse files Browse the repository at this point in the history
  • Loading branch information
madmaxoft committed Aug 22, 2019
1 parent c046fe8 commit 829bfa7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion biomeidentifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,12 @@ BiomeIdentifier& BiomeIdentifier::Instance() {
}

BiomeInfo &BiomeIdentifier::getBiome(int biome) {
QList<BiomeInfo*> &list = biomes[biome];
auto itr = biomes.find(biome);
if (itr == biomes.end())
{
return unknownBiome;
}
QList<BiomeInfo*> &list = *itr;
// search backwards for priority sorting to work
for (int i = list.length() - 1; i >= 0; i--)
if (list[i]->enabled)
Expand Down

0 comments on commit 829bfa7

Please sign in to comment.