From 9e4fe3809efc4b74f514c3965e4c6415abc02152 Mon Sep 17 00:00:00 2001 From: fgenesis Date: Mon, 23 Jul 2012 05:06:01 +0200 Subject: [PATCH] Fix crash added with last commit, thx KS-10 for pointing --- Aquaria/ScriptInterface.cpp | 2 +- BBGE/Localization.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Aquaria/ScriptInterface.cpp b/Aquaria/ScriptInterface.cpp index c188e57..03858f1 100644 --- a/Aquaria/ScriptInterface.cpp +++ b/Aquaria/ScriptInterface.cpp @@ -8952,7 +8952,7 @@ void ScriptInterface::shutdown() Script *ScriptInterface::openScript(const std::string &file, bool ignoremissing /* = false */) { - std::string realFile = localisePath(file, dsq->mod.isActive() ? dsq->mod.getPath() : ""); + std::string realFile = localisePathInternalModpath(file); realFile = core->adjustFilenameCase(realFile); bool loadedScript = false; diff --git a/BBGE/Localization.cpp b/BBGE/Localization.cpp index 8f5f070..4669814 100644 --- a/BBGE/Localization.cpp +++ b/BBGE/Localization.cpp @@ -62,6 +62,8 @@ std::string localisePath(const std::string &path, const std::string& modpath /* { if (s_locale.empty() || s_locale == "-") return path; + if(path.length() < modpath.length()) + return path; const std::string fname = path.substr(modpath.length());