summaryrefslogtreecommitdiffstats
path: root/src/Generating
diff options
context:
space:
mode:
authorDayBr3ak <benj.groeneveld@gmail.com>2014-09-02 18:05:53 +0200
committerDayBr3ak <benj.groeneveld@gmail.com>2014-09-02 18:05:53 +0200
commit29811c4f2155bb3dd03b81803b58df45e15b84f4 (patch)
tree1d3c735badb352d36aaf263155e672d23f8182d4 /src/Generating
parentchanging implem, using vectors (diff)
downloadcuberite-29811c4f2155bb3dd03b81803b58df45e15b84f4.tar
cuberite-29811c4f2155bb3dd03b81803b58df45e15b84f4.tar.gz
cuberite-29811c4f2155bb3dd03b81803b58df45e15b84f4.tar.bz2
cuberite-29811c4f2155bb3dd03b81803b58df45e15b84f4.tar.lz
cuberite-29811c4f2155bb3dd03b81803b58df45e15b84f4.tar.xz
cuberite-29811c4f2155bb3dd03b81803b58df45e15b84f4.tar.zst
cuberite-29811c4f2155bb3dd03b81803b58df45e15b84f4.zip
Diffstat (limited to '')
-rw-r--r--src/Generating/BioGen.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Generating/BioGen.cpp b/src/Generating/BioGen.cpp
index 4936fc251..698b9463b 100644
--- a/src/Generating/BioGen.cpp
+++ b/src/Generating/BioGen.cpp
@@ -215,7 +215,6 @@ cBioGenMulticache::cBioGenMulticache(cBiomeGen * a_BioGenToCache, int a_CacheSiz
m_CachesLength(a_CachesLength),
m_InternalCacheLength(a_CachesLength * a_CacheSize)
{
- //m_Caches = new std::vector<cBiomeGen*>;
m_Caches.reserve(m_InternalCacheLength);
for (int i = 0; i < m_InternalCacheLength; i++) {
m_Caches.push_back(new cBioGenCache(a_BioGenToCache, a_CacheSize));
@@ -228,7 +227,10 @@ m_InternalCacheLength(a_CachesLength * a_CacheSize)
cBioGenMulticache::~cBioGenMulticache()
{
- m_Caches.erase(m_Caches.cbegin(), m_Caches.cend());
+ for (std::vector<cBiomeGen*>::iterator it = m_Caches.begin(); it != m_Caches.end(); it++)
+ {
+ delete *it;
+ }
}
@@ -249,8 +251,7 @@ void cBioGenMulticache::GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMa
void cBioGenMulticache::InitializeBiomeGen(cIniFile & a_IniFile)
{
- //super::InitializeBiomeGen(a_IniFile);
- for (auto it = m_Caches.begin(); it != m_Caches.end(); it++)
+ for (std::vector<cBiomeGen*>::iterator it = m_Caches.begin(); it != m_Caches.end(); it++)
{
cBiomeGen * tmp = *it;
tmp->InitializeBiomeGen(a_IniFile);