Moved door towards background
[supertux.git] / src / trigger / scripttrigger.cpp
index 0793992..cc330a2 100644 (file)
@@ -1,7 +1,7 @@
 //  $Id$\r
-// \r
+//\r
 //  SuperTux\r
-//  Copyright (C) 2005 Matthias Braun <matze@braunis.de>\r
+//  Copyright (C) 2006 Matthias Braun <matze@braunis.de>\r
 //\r
 //  This program is free software; you can redistribute it and/or\r
 //  modify it under the terms of the GNU General Public License\r
 //  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
 //  GNU General Public License for more details.\r
-// \r
+//\r
 //  You should have received a copy of the GNU General Public License\r
 //  along with this program; if not, write to the Free Software\r
-//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA\r
-//  02111-1307, USA.\r
-//\r
+//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.\r
+\r
 #include <config.h>\r
 \r
 #include <sstream>\r
@@ -29,7 +28,6 @@
 #include "lisp/lisp.hpp"\r
 #include "lisp/writer.hpp"\r
 #include "object_factory.hpp"\r
-#include "scripting/script_interpreter.hpp"\r
 #include "sector.hpp"\r
 \r
 ScriptTrigger::ScriptTrigger(const lisp::Lisp& reader)\r
@@ -87,8 +85,8 @@ ScriptTrigger::event(Player& , EventType type)
   if(type != triggerevent)\r
     return;\r
 \r
-  ScriptInterpreter::add_script_object(Sector::current(), "trigger - scritp",\r
-      script);\r
+  std::istringstream stream(script);\r
+  Sector::current()->run_script(stream, "ScriptTrigger");\r
 }\r
 \r
 IMPLEMENT_FACTORY(ScriptTrigger, "scripttrigger");\r