From 2fa455ff7870dc09d75bb89a897c7c1d26eb9020 Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Tue, 14 Aug 2007 16:34:34 +0000 Subject: Made it possible to load scripts from strings instead of files. --- src/scripting/script.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/scripting/script.cpp') diff --git a/src/scripting/script.cpp b/src/scripting/script.cpp index 4d917273..12aa0d18 100644 --- a/src/scripting/script.cpp +++ b/src/scripting/script.cpp @@ -43,7 +43,7 @@ void Script::registerEngine(std::string const &name, Factory f) (*engines)[name] = f; } -Script *Script::create(std::string const &engine, std::string const &file) +Script *Script::create(std::string const &engine) { Engines::const_iterator i = engines->find(engine); if (i == engines->end()) @@ -51,12 +51,7 @@ Script *Script::create(std::string const &engine, std::string const &file) LOG_ERROR("No scripting engine named " << engine); return NULL; } - Script *s = i->second(file); - if (!s) - { - LOG_ERROR("Failure while loading script " << file); - } - return s; + return i->second(); } void Script::update() -- cgit v1.2.3-60-g2f50