Index: trunk/src/lib/script_engine/script.cc
===================================================================
--- trunk/src/lib/script_engine/script.cc	(revision 9061)
+++ trunk/src/lib/script_engine/script.cc	(revision 9235)
@@ -26,4 +26,5 @@
 CREATE_SCRIPTABLE_CLASS(Script, CL_SCRIPT,
                     addMethod("addObject", ExecutorLua2<Script,const std::string&, const std::string& >(&Script::addObject))
+                    ->addMethod("registerClass", ExecutorLua1<Script,const std::string&>(&Script::registerClass))
                     ->addMethod("selectFunction", ExecutorLua2ret<Script, bool, const std::string&, int >(&Script::selectFunction))
                     ->addMethod("executeFunction", ExecutorLua0ret<Script,bool >(&Script::executeFunction))
@@ -78,5 +79,4 @@
 bool Script::loadFile(const std::string& filename)
  {
-   this->setName(filename);
    std::string filedest(ResourceManager::getInstance()->getDataDir());
    filedest += "scripts/" + filename;
@@ -95,10 +95,9 @@
    if(error == 0)
    {
-     
+     currentFile = filename;
      error = lua_pcall(luaState, 0, 0, 0);
 
      if(error == 0)
      {
-      currentFile = filename;
       return true;
      }
@@ -358,6 +357,7 @@
    bool success = false;
    
-   //success = this->registerClass(std::string("Vector"));
-    success = this->registerClass("ScriptTrigger");
+   //this->registerClass(std::string("Vector"));
+    this->registerClass("ScriptTrigger");
+  //  this->registerClass("AttractorMine");
 
    return success;
@@ -365,5 +365,5 @@
  
  
- bool Script::registerClass( const std::string& className)
+ void Script::registerClass( const std::string& className)
  {
    BaseObject* scriptClass = ClassList::getObject(className, CL_SCRIPT_CLASS);
@@ -378,16 +378,29 @@
        tmpObj.name = "";
        registeredObjects.push_back(tmpObj);
+       return;
+     }
+   }
+ 
+ }
+
+ bool Script::classIsRegistered(const std::string& type)
+ {
+   for(std::list<WorldObject>::const_iterator it = registeredObjects.begin(); it != registeredObjects.end(); it++ )
+   {
+     if( (*it).type == type)
+     {
        return true;
      }
    }
    return false;
- 
- }
-
- bool Script::classIsRegistered(const std::string& type)
+ }
+
+
+
+ bool Script::objectIsAdded(const std::string& name)
  {
    for(std::list<WorldObject>::const_iterator it = registeredObjects.begin(); it != registeredObjects.end(); it++ )
    {
-     if( (*it).type == type)
+     if( (*it).name == name)
      {
        return true;
@@ -395,19 +408,5 @@
    }
    return false;
- }
-
-
-
- bool Script::objectIsAdded(const std::string& name)
- {
-   for(std::list<WorldObject>::const_iterator it = registeredObjects.begin(); it != registeredObjects.end(); it++ )
-   {
-     if( (*it).name == name)
-     {
-       return true;
-     }
-   }
-   return false;
-
-
- }
+
+
+ }
Index: trunk/src/lib/script_engine/script.h
===================================================================
--- trunk/src/lib/script_engine/script.h	(revision 9061)
+++ trunk/src/lib/script_engine/script.h	(revision 9235)
@@ -32,4 +32,5 @@
     bool loadFile(const std::string& filename);
     void addObject( const std::string& className,const std::string& objectName);
+    void registerClass(const std::string& className);                           //!< Register a class but dont add any instances 
 
     /// QUERRYING
@@ -64,5 +65,4 @@
     int  reportError(int error);                      //!< Get errormessage from the lua stack and print it.
     bool registerStandartClasses();                   //!< Register all the classes that the script might need
-    bool registerClass(const std::string& className); //!< Register a class but dont add any instances 
     bool classIsRegistered(const std::string& type);  //!< Checks wheter the class "type" has already been registered with the script
     bool objectIsAdded(const std::string& name);      //!< Checks wheter the object "name" has already been added to the script
