Made the per save onLoad and onUnload script use the right separator character for different operating systems.

develop
expwnent 2013-06-10 15:55:54 -04:00
parent 57c42e3927
commit 1b260fe549
1 changed files with 6 additions and 1 deletions

@ -1300,7 +1300,12 @@ void Core::onUpdate(color_ostream &out)
static void handleLoadAndUnloadScripts(Core* core, color_ostream& out, state_change_event event) { static void handleLoadAndUnloadScripts(Core* core, color_ostream& out, state_change_event event) {
//TODO: use different separators for windows //TODO: use different separators for windows
std::string rawFolder = "data/save/" + (df::global::world->cur_savegame.save_dir) + "/raw/"; #ifdef _WIN32
static const std::string separator = "\\";
#else
static const std::string separator = "/";
#endif
std::string rawFolder = "data" + separator + "save" + separator + (df::global::world->cur_savegame.save_dir) + separator + "raw" + separator;
switch(event) { switch(event) {
case SC_WORLD_LOADED: case SC_WORLD_LOADED:
core->loadScriptFile(out, rawFolder + "onLoad.init", true); core->loadScriptFile(out, rawFolder + "onLoad.init", true);