The game didn't allocate memory if data was in a subdir of "data". Fixed

git-svn-id: https://clonekeenplus.svn.sourceforge.net/svnroot/clonekeenplus/cgenius/trunk@125 4df4b0f3-56ce-47cb-b001-ed939b7d65a6
This commit is contained in:
gerstrong
2009-07-24 07:33:37 +00:00
parent 08196ff543
commit d5b1cf1857
5 changed files with 3 additions and 4 deletions

View File

@@ -17,6 +17,7 @@ using namespace std;
CExeFile::CExeFile(int episode, const std::string& datadirectory) {
m_episode = episode;
m_datadirectory = datadirectory;
if(m_datadirectory != "") m_datadirectory += "/";
m_data = NULL;
}
@@ -29,6 +30,7 @@ bool CExeFile::readData()
std::string filename = "data/" + m_datadirectory + "keen" + itoa(m_episode) + ".exe";
std::ifstream File(filename.c_str(),ios::binary);
// TODO: If Exe-file wasn't detected, make the program quit somehow, or it crashes
if(!File) return false;