Fixed cleanup func pos (segfaults...)
This commit is contained in:
parent
e80246c3df
commit
26549197ce
|
@ -296,15 +296,13 @@ bool GameOfLife::load(std::string file) {
|
||||||
std::ifstream data(file.c_str());
|
std::ifstream data(file.c_str());
|
||||||
if(!data)
|
if(!data)
|
||||||
return false;
|
return false;
|
||||||
|
cleanup();
|
||||||
std::string tmp;
|
std::string tmp;
|
||||||
data >> x;
|
data >> x;
|
||||||
data >> y;
|
data >> y;
|
||||||
data >> torus;
|
data >> torus;
|
||||||
if(x<=0 || y <=0)
|
if(x<=0 || y <=0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
cleanup();
|
|
||||||
allocate();
|
allocate();
|
||||||
int j=0;
|
int j=0;
|
||||||
getline(data, tmp); // Remove \n
|
getline(data, tmp); // Remove \n
|
||||||
|
@ -314,7 +312,6 @@ bool GameOfLife::load(std::string file) {
|
||||||
}
|
}
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -521,7 +518,6 @@ float GameOfLife::getBuildSec() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameOfLife::setTickSec(float s) {
|
void GameOfLife::setTickSec(float s) {
|
||||||
std::cout << "Set to " << s << std::endl;
|
|
||||||
secpertick = s;
|
secpertick = s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue