diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-07-24 19:48:33 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-07-24 19:48:33 +0000 |
commit | 077e58415a7f6f2c55865be2c2fc35892450dd38 (patch) | |
tree | 4936af8a5c56aecbf74e668c57e9b104cda4008a /src/main.cpp | |
parent | b7f7b15995cfc9b41100e237bebc7f2c009e56b3 (diff) | |
download | mana-077e58415a7f6f2c55865be2c2fc35892450dd38.tar.gz mana-077e58415a7f6f2c55865be2c2fc35892450dd38.tar.bz2 mana-077e58415a7f6f2c55865be2c2fc35892450dd38.tar.xz mana-077e58415a7f6f2c55865be2c2fc35892450dd38.zip |
Fixed the loading of updates and made skipping the update process also skip thev0.0.20
loading of updates.
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/main.cpp b/src/main.cpp index 28debf47..86d29167 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -134,7 +134,9 @@ void init_engine() if ((mkdir(homeDir.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) != 0) && (errno != EEXIST)) { - std::cout << homeDir << " can't be made, but it doesn't exist! Exitting." << std::endl; + std::cout << homeDir + << " can't be made, but it doesn't exist! Exitting." + << std::endl; exit(1); } #endif @@ -145,7 +147,9 @@ void init_engine() ResourceManager *resman = ResourceManager::getInstance(); if (!resman->setWriteDir(homeDir)) { - std::cout << homeDir << " couldn't be set as home directory! Exitting." << std::endl; + std::cout << homeDir + << " couldn't be set as home directory! Exitting." + << std::endl; exit(1); } @@ -154,8 +158,10 @@ void init_engine() // Creating and checking the updates folder existence and rights. if (!resman->isDirectory("/updates")) { if (!resman->mkdir("/updates")) { - std::cout << homeDir << "/updates can't be made, but it doesn't exist! Exitting." << std::endl; - exit(1); + std::cout << homeDir << "/updates " + << "can't be made, but it doesn't exist! Exitting." + << std::endl; + exit(1); } } @@ -393,10 +399,11 @@ void loadUpdates() const std::string updatesFile = "updates/resources.txt"; ResourceManager *resman = ResourceManager::getInstance(); std::vector<std::string> lines = resman->loadTextFile(updatesFile); + std::string homeDir = config.getValue("homeDir", ""); for (unsigned int i = 0; i < lines.size(); ++i) { - resman->addToSearchPath(lines[i], false); + resman->addToSearchPath(homeDir + "/updates/" + lines[i], false); } } @@ -513,7 +520,6 @@ int main(int argc, char *argv[]) SDL_Event event; if (options.skipUpdate && state != ERROR_STATE) { - loadUpdates(); state = LOGIN_STATE; } else { |