Commit 077e58415a7f6f2c55865be2c2fc35892450dd38

Fixed the loading of updates and made skipping the update process also skip the
loading of updates.
ChangeLog
(5 / 0)
  
12006-07-24 Bjørn Lindeijer <bjorn@lindeijer.nl>
2
3 * src/main.cpp: Fixed the loading of updates and made skipping the
4 update process also skip the loading of updates.
5
162006-07-24 Björn Steinbrink <B.Steinbrink@gmx.de>
27
38 * src/localplayer.cpp, src/being.cpp: Fixed setDirection() semantics.
  
8989 };
9090
9191
92
9392 /**
9493 * Directions, to be used as bitmask values
9594 */
src/main.cpp
(12 / 6)
  
134134 if ((mkdir(homeDir.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) != 0) &&
135135 (errno != EEXIST))
136136 {
137 std::cout << homeDir << " can't be made, but it doesn't exist! Exitting." << std::endl;
137 std::cout << homeDir
138 << " can't be made, but it doesn't exist! Exitting."
139 << std::endl;
138140 exit(1);
139141 }
140142#endif
147147 ResourceManager *resman = ResourceManager::getInstance();
148148
149149 if (!resman->setWriteDir(homeDir)) {
150 std::cout << homeDir << " couldn't be set as home directory! Exitting." << std::endl;
150 std::cout << homeDir
151 << " couldn't be set as home directory! Exitting."
152 << std::endl;
151153 exit(1);
152154 }
153155
158158 // Creating and checking the updates folder existence and rights.
159159 if (!resman->isDirectory("/updates")) {
160160 if (!resman->mkdir("/updates")) {
161 std::cout << homeDir << "/updates can't be made, but it doesn't exist! Exitting." << std::endl;
162 exit(1);
161 std::cout << homeDir << "/updates "
162 << "can't be made, but it doesn't exist! Exitting."
163 << std::endl;
164 exit(1);
163165 }
164166 }
165167
399399 const std::string updatesFile = "updates/resources.txt";
400400 ResourceManager *resman = ResourceManager::getInstance();
401401 std::vector<std::string> lines = resman->loadTextFile(updatesFile);
402 std::string homeDir = config.getValue("homeDir", "");
402403
403404 for (unsigned int i = 0; i < lines.size(); ++i)
404405 {
405 resman->addToSearchPath(lines[i], false);
406 resman->addToSearchPath(homeDir + "/updates/" + lines[i], false);
406407 }
407408}
408409
520520 SDL_Event event;
521521
522522 if (options.skipUpdate && state != ERROR_STATE) {
523 loadUpdates();
524523 state = LOGIN_STATE;
525524 }
526525 else {