From 1b260fe549f10566df9fe861249209ca74c0ed40 Mon Sep 17 00:00:00 2001 From: expwnent Date: Mon, 10 Jun 2013 15:55:54 -0400 Subject: [PATCH] Made the per save onLoad and onUnload script use the right separator character for different operating systems. --- library/Core.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/library/Core.cpp b/library/Core.cpp index 094829300..51080349b 100644 --- a/library/Core.cpp +++ b/library/Core.cpp @@ -1300,7 +1300,12 @@ void Core::onUpdate(color_ostream &out) static void handleLoadAndUnloadScripts(Core* core, color_ostream& out, state_change_event event) { //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) { case SC_WORLD_LOADED: core->loadScriptFile(out, rawFolder + "onLoad.init", true);