Index: code/branches/pickup/src/modules/CMakeLists.txt
===================================================================
--- code/branches/pickup/src/modules/CMakeLists.txt	(revision 5815)
+++ code/branches/pickup/src/modules/CMakeLists.txt	(revision 5935)
@@ -27,5 +27,4 @@
 ################ Sub Directories ################
 
-ADD_SUBDIRECTORY(gamestates)
 ADD_SUBDIRECTORY(objects)
 ADD_SUBDIRECTORY(overlays)
Index: code/branches/pickup/src/modules/objects/Attacher.cc
===================================================================
--- code/branches/pickup/src/modules/objects/Attacher.cc	(revision 5815)
+++ code/branches/pickup/src/modules/objects/Attacher.cc	(revision 5935)
@@ -53,6 +53,6 @@
     void Attacher::processEvent(Event& event)
     {
-        for (std::list<WorldEntity*>::iterator it = this->objects_.begin(); it != this->objects_.end(); ++it)
-            (*it)->fireEvent(event);
+        if (this->target_)
+            this->target_->processEvent(event);
     }
 
@@ -102,6 +102,11 @@
 
         for (ObjectList<WorldEntity>::iterator it = ObjectList<WorldEntity>::begin(); it != ObjectList<WorldEntity>::end(); ++it)
+        {
             if (it->getName() == this->targetname_)
+            {
+                this->target_ = *it;
                 this->attachToParent(*it);
+            }
+        }
     }
 
Index: code/branches/pickup/src/modules/objects/ObjectsPrereqs.h
===================================================================
--- code/branches/pickup/src/modules/objects/ObjectsPrereqs.h	(revision 5815)
+++ code/branches/pickup/src/modules/objects/ObjectsPrereqs.h	(revision 5935)
@@ -28,6 +28,7 @@
 
 /**
-  @file
-  @brief Contains all the necessary forward declarations for all classes and structs.
+@file
+@brief
+    Shared library macros, enums, constants and forward declarations for the objects module
 */
 
@@ -36,5 +37,4 @@
 
 #include "OrxonoxConfig.h"
-
 #include "OrxonoxPrereqs.h"
 
@@ -42,4 +42,5 @@
 // Shared library settings
 //-----------------------------------------------------------------------
+
 #if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(ORXONOX_STATIC_BUILD)
 #  ifdef OBJECTS_SHARED_BUILD
@@ -76,13 +77,15 @@
 
     // eventsystem
+    class EventDispatcher;
+    class EventFilter;
     class EventListener;
-    class EventDispatcher;
+    class EventName;
     class EventTarget;
 
     // triggers
-    class Trigger;
+    class CheckPoint;
     class DistanceTrigger;
     class EventTrigger;
-    class CheckPoint;
+    class Trigger;
 }
 
Index: code/branches/pickup/src/modules/objects/Planet.cc
===================================================================
--- code/branches/pickup/src/modules/objects/Planet.cc	(revision 5815)
+++ code/branches/pickup/src/modules/objects/Planet.cc	(revision 5935)
@@ -47,5 +47,5 @@
      * @brief Constructor
      */
-    Planet::Planet(BaseObject* creator): MovableEntity(creator)
+    Planet::Planet(BaseObject* creator) : MovableEntity(creator)
     {
         RegisterObject(Planet);
@@ -64,5 +64,5 @@
     void Planet::tick(float dt)
     {
-        if(!this->isVisible())
+        if (!this->isVisible())
             return;
 
@@ -70,5 +70,5 @@
         {
             Camera* activeCamera = CameraManager::getInstance().getActiveCamera();
-            if(activeCamera)
+            if (activeCamera)
             {
                 float distance = this->getPosition().distance( activeCamera->getWorldPosition() );
Index: code/branches/pickup/src/modules/objects/eventsystem/CMakeLists.txt
===================================================================
--- code/branches/pickup/src/modules/objects/eventsystem/CMakeLists.txt	(revision 5815)
+++ code/branches/pickup/src/modules/objects/eventsystem/CMakeLists.txt	(revision 5935)
@@ -1,5 +1,7 @@
 ADD_SOURCE_FILES(OBJECTS_SRC_FILES
   EventDispatcher.cc
+  EventFilter.cc
   EventListener.cc
+  EventName.cc
   EventTarget.cc
 )
Index: code/branches/pickup/src/modules/objects/eventsystem/EventDispatcher.cc
===================================================================
--- code/branches/pickup/src/modules/objects/eventsystem/EventDispatcher.cc	(revision 5815)
+++ code/branches/pickup/src/modules/objects/eventsystem/EventDispatcher.cc	(revision 5935)
@@ -32,5 +32,4 @@
 #include "core/EventIncludes.h"
 #include "core/XMLPort.h"
-#include "EventTarget.h"
 
 namespace orxonox
@@ -46,6 +45,6 @@
     {
         if (this->isInitialized())
-            for (std::list<EventTarget*>::iterator it = this->targets_.begin(); it != this->targets_.end(); ++it)
-                delete (*it);
+            for (std::list<BaseObject*>::iterator it = this->targets_.begin(); it != this->targets_.end(); ++it)
+                (*it)->destroy();
     }
 
@@ -54,22 +53,25 @@
         SUPER(EventDispatcher, XMLPort, xmlelement, mode);
 
-        XMLPortObject(EventDispatcher, EventTarget, "targets", addTarget, getTarget, xmlelement, mode);
+        XMLPortObject(EventDispatcher, BaseObject, "targets", addTarget, getTarget, xmlelement, mode);
+
+        // since we need event sources mapped to any state, we have to parse XML by ourselves
+        this->loadAllEventStates(xmlelement, mode, this, Class(EventDispatcher));
     }
 
     void EventDispatcher::processEvent(Event& event)
     {
-        for (std::list<EventTarget*>::iterator it = this->targets_.begin(); it != this->targets_.end(); ++it)
-            (*it)->fireEvent(event);
+        for (std::list<BaseObject*>::iterator it = this->targets_.begin(); it != this->targets_.end(); ++it)
+            (*it)->processEvent(event);
     }
 
-    void EventDispatcher::addTarget(EventTarget* target)
+    void EventDispatcher::addTarget(BaseObject* target)
     {
         this->targets_.push_back(target);
     }
 
-    EventTarget* EventDispatcher::getTarget(unsigned int index) const
+    BaseObject* EventDispatcher::getTarget(unsigned int index) const
     {
         unsigned int i = 0;
-        for (std::list<EventTarget*>::const_iterator it = this->targets_.begin(); it != this->targets_.end(); ++it)
+        for (std::list<BaseObject*>::const_iterator it = this->targets_.begin(); it != this->targets_.end(); ++it)
         {
             if (i == index)
Index: code/branches/pickup/src/modules/objects/eventsystem/EventDispatcher.h
===================================================================
--- code/branches/pickup/src/modules/objects/eventsystem/EventDispatcher.h	(revision 5815)
+++ code/branches/pickup/src/modules/objects/eventsystem/EventDispatcher.h	(revision 5935)
@@ -47,9 +47,9 @@
             virtual void processEvent(Event& event);
 
-            void addTarget(EventTarget* target);
-            EventTarget* getTarget(unsigned int index) const;
+            void addTarget(BaseObject* target);
+            BaseObject* getTarget(unsigned int index) const;
 
         private:
-            std::list<EventTarget*> targets_;
+            std::list<BaseObject*> targets_;
     };
 }
Index: code/branches/pickup/src/modules/objects/eventsystem/EventFilter.cc
===================================================================
--- code/branches/pickup/src/modules/objects/eventsystem/EventFilter.cc	(revision 5935)
+++ code/branches/pickup/src/modules/objects/eventsystem/EventFilter.cc	(revision 5935)
@@ -0,0 +1,122 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "EventFilter.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "EventName.h"
+
+namespace orxonox
+{
+    CreateFactory(EventFilter);
+
+    EventFilter::EventFilter(BaseObject* creator) : BaseObject(creator)
+    {
+        RegisterObject(EventFilter);
+
+        this->bActive_ = false;
+    }
+
+    EventFilter::~EventFilter()
+    {
+        for (std::list<EventName*>::const_iterator it = this->names_.begin(); it != this->names_.end(); )
+            (*(it++))->destroy();
+    }
+
+    void EventFilter::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(EventFilter, XMLPort, xmlelement, mode);
+
+        XMLPortObject(EventFilter, BaseObject, "", addFilterSource, getFilterSource, xmlelement, mode);
+        XMLPortObject(EventFilter, EventName, "names", addEventName, getEventName, xmlelement, mode);
+    }
+
+    void EventFilter::processEvent(Event& event)
+    {
+        if (this->bActive_)
+        {
+            COUT(2) << "Warning: Detected Event loop in EventFilter \"" << this->getName() << "\"" << std::endl;
+            return;
+        }
+
+        if (this->names_.size() > 0)
+        {
+            bool success = false;
+            for (std::list<EventName*>::const_iterator it = this->names_.begin(); it != this->names_.end(); ++it)
+            {
+                if ((*it)->getName() == event.name_)
+                {
+                    success = true;
+                    break;
+                }
+            }
+            if (!success)
+                return;
+        }
+
+        this->bActive_ = true;
+        this->fireEvent(event.activate_, event.originator_, event.name_);
+        this->bActive_ = false;
+    }
+
+    void EventFilter::addFilterSource(BaseObject* source)
+    {
+        this->sources_.push_back(source);
+        this->addEventSource(source, "");
+    }
+
+    BaseObject* EventFilter::getFilterSource(unsigned int index) const
+    {
+        unsigned int i = 0;
+        for (std::list<BaseObject*>::const_iterator it = this->sources_.begin(); it != this->sources_.end(); ++it)
+        {
+            if (i == index)
+                return (*it);
+            ++i;
+        }
+        return 0;
+    }
+
+    void EventFilter::addEventName(EventName* eventname)
+    {
+        this->names_.push_back(eventname);
+    }
+
+    EventName* EventFilter::getEventName(unsigned int index) const
+    {
+        unsigned int i = 0;
+        for (std::list<EventName*>::const_iterator it = this->names_.begin(); it != this->names_.end(); ++it)
+        {
+            if (i == index)
+                return (*it);
+            ++i;
+        }
+        return 0;
+    }
+}
Index: code/branches/pickup/src/modules/objects/eventsystem/EventFilter.h
===================================================================
--- code/branches/pickup/src/modules/objects/eventsystem/EventFilter.h	(revision 5935)
+++ code/branches/pickup/src/modules/objects/eventsystem/EventFilter.h	(revision 5935)
@@ -0,0 +1,62 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _EventFilter_H__
+#define _EventFilter_H__
+
+#include "objects/ObjectsPrereqs.h"
+
+#include <list>
+#include "core/BaseObject.h"
+
+namespace orxonox
+{
+    class _ObjectsExport EventFilter : public BaseObject
+    {
+        public:
+            EventFilter(BaseObject* creator);
+            virtual ~EventFilter();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+            virtual void processEvent(Event& event);
+
+            void addFilterSource(BaseObject* source);
+            BaseObject* getFilterSource(unsigned int index) const;
+
+            void addEventName(EventName* eventname);
+            EventName* getEventName(unsigned int index) const;
+
+        private:
+            std::list<BaseObject*> sources_;
+            std::list<EventName*> names_;
+            bool bActive_;
+    };
+}
+
+#endif /* _EventFilter_H__ */
Index: code/branches/pickup/src/modules/objects/eventsystem/EventListener.cc
===================================================================
--- code/branches/pickup/src/modules/objects/eventsystem/EventListener.cc	(revision 5815)
+++ code/branches/pickup/src/modules/objects/eventsystem/EventListener.cc	(revision 5935)
@@ -63,7 +63,5 @@
 
         this->bActive_ = true;
-
-        this->fireEvent(event.activate_, event.originator_);
-
+        this->fireEvent(event.activate_, event.originator_, event.name_);
         this->bActive_ = false;
     }
@@ -78,5 +76,5 @@
         for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it != ObjectList<BaseObject>::end(); ++it)
             if (it->getName() == this->eventName_)
-                this->registerAsListener(*it);
+                this->addEventSource(*it, "");
     }
 
@@ -87,10 +85,5 @@
 
         if (object->getName() == this->eventName_)
-            this->registerAsListener(object);
-    }
-
-    void EventListener::registerAsListener(BaseObject* object)
-    {
-        object->registerEventListener(this, "");
+            this->addEventSource(object, "");
     }
 }
Index: code/branches/pickup/src/modules/objects/eventsystem/EventListener.h
===================================================================
--- code/branches/pickup/src/modules/objects/eventsystem/EventListener.h	(revision 5815)
+++ code/branches/pickup/src/modules/objects/eventsystem/EventListener.h	(revision 5935)
@@ -54,5 +54,4 @@
         private:
             virtual void loadedNewXMLName(BaseObject* object);
-            void registerAsListener(BaseObject* object);
 
             std::string eventName_;
Index: code/branches/pickup/src/modules/objects/eventsystem/EventName.cc
===================================================================
--- code/branches/pickup/src/modules/objects/eventsystem/EventName.cc	(revision 5935)
+++ code/branches/pickup/src/modules/objects/eventsystem/EventName.cc	(revision 5935)
@@ -0,0 +1,40 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "EventName.h"
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    CreateFactory(EventName);
+
+    EventName::EventName(BaseObject* creator) : BaseObject(creator)
+    {
+        RegisterObject(EventName);
+    }
+}
Index: code/branches/pickup/src/modules/objects/eventsystem/EventName.h
===================================================================
--- code/branches/pickup/src/modules/objects/eventsystem/EventName.h	(revision 5935)
+++ code/branches/pickup/src/modules/objects/eventsystem/EventName.h	(revision 5935)
@@ -0,0 +1,46 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _EventName_H__
+#define _EventName_H__
+
+#include "objects/ObjectsPrereqs.h"
+
+#include "core/BaseObject.h"
+
+namespace orxonox
+{
+    class _ObjectsExport EventName : public BaseObject
+    {
+        public:
+            EventName(BaseObject* creator);
+            virtual ~EventName() {}
+    };
+}
+
+#endif /* _EventName_H__ */
Index: code/branches/pickup/src/modules/objects/eventsystem/EventTarget.cc
===================================================================
--- code/branches/pickup/src/modules/objects/eventsystem/EventTarget.cc	(revision 5815)
+++ code/branches/pickup/src/modules/objects/eventsystem/EventTarget.cc	(revision 5935)
@@ -29,4 +29,5 @@
 #include "EventTarget.h"
 #include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
 
 namespace orxonox
@@ -37,4 +38,6 @@
     {
         RegisterObject(EventTarget);
+
+        this->bActive_ = false;
     }
 
@@ -42,27 +45,50 @@
     {
     }
+    
+    void EventTarget::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(EventTarget, XMLPort, xmlelement, mode);
 
-    void EventTarget::changedName()
+        XMLPortParam(EventTarget, "target", setTargetName, getTargetName, xmlelement, mode);
+
+        // since we need event sources mapped to any state, we have to parse XML by ourselves
+        this->loadAllEventStates(xmlelement, mode, this, Class(EventTarget));
+    }
+
+    void EventTarget::processEvent(Event& event)
     {
-        SUPER(EventTarget, changedName);
+        if (this->bActive_)
+        {
+            COUT(2) << "Warning: Detected Event loop in EventTarget \"" << this->getName() << "\"" << std::endl;
+            return;
+        }
 
+        this->bActive_ = true;
+        this->fireEvent(event);
+        this->bActive_ = false;
+    }
+
+    void EventTarget::setTargetName(const std::string& name)
+    {
+        this->target_ = name;
+        
         for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it != ObjectList<BaseObject>::end(); ++it)
-            if (it->getName() == this->getName())
-                this->addAsEvent(*it);
+            if (it->getName() == this->target_)
+                this->addEventTarget(*it);
     }
 
     void EventTarget::loadedNewXMLName(BaseObject* object)
     {
-        if (this->getName() == "")
+        if (this->target_ == "")
             return;
 
-        if (object->getName() == this->getName())
-            this->addAsEvent(object);
+        if (object->getName() == this->target_)
+            this->addEventTarget(object);
     }
 
-    void EventTarget::addAsEvent(BaseObject* object)
+    void EventTarget::addEventTarget(BaseObject* object)
     {
         if (object != static_cast<BaseObject*>(this))
-            object->addEvent(this, "");
+            object->addEventSource(this, "");
     }
 }
Index: code/branches/pickup/src/modules/objects/eventsystem/EventTarget.h
===================================================================
--- code/branches/pickup/src/modules/objects/eventsystem/EventTarget.h	(revision 5815)
+++ code/branches/pickup/src/modules/objects/eventsystem/EventTarget.h	(revision 5935)
@@ -42,10 +42,19 @@
             EventTarget(BaseObject* creator);
             virtual ~EventTarget();
+            
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            
+            virtual void processEvent(Event& event);
 
-            virtual void changedName();
+            void setTargetName(const std::string& name);
+            inline const std::string& getTargetName() const
+                { return this->target_; }
 
         private:
             virtual void loadedNewXMLName(BaseObject* object);
-            void addAsEvent(BaseObject* object);
+            void addEventTarget(BaseObject* object);
+            
+            std::string target_;
+            bool bActive_;
     };
 }
Index: code/branches/pickup/src/modules/objects/triggers/CheckPoint.cc
===================================================================
--- code/branches/pickup/src/modules/objects/triggers/CheckPoint.cc	(revision 5815)
+++ code/branches/pickup/src/modules/objects/triggers/CheckPoint.cc	(revision 5935)
@@ -85,5 +85,5 @@
         DistanceTrigger::triggered(bIsTriggered);
 
-        Asteroids* gametype = orxonox_cast<Asteroids*>(this->getGametype());
+        Asteroids* gametype = orxonox_cast<Asteroids*>(this->getGametype().get());
         if (gametype)
         {
Index: code/branches/pickup/src/modules/objects/triggers/EventTrigger.cc
===================================================================
--- code/branches/pickup/src/modules/objects/triggers/EventTrigger.cc	(revision 5815)
+++ code/branches/pickup/src/modules/objects/triggers/EventTrigger.cc	(revision 5935)
@@ -47,9 +47,9 @@
     }
 
-    void EventTrigger::processEvent(Event& event)
+    void EventTrigger::XMLEventPort(Element& xmlelement, XMLPort::Mode mode)
     {
-        SUPER(EventTrigger, processEvent, event);
+        SUPER(EventTrigger, XMLEventPort, xmlelement, mode);
 
-        ORXONOX_SET_EVENT(EventTrigger, "trigger", trigger, event);
+        XMLPortEventState(EventTrigger, BaseObject, "trigger", trigger, xmlelement, mode);
     }
 
Index: code/branches/pickup/src/modules/objects/triggers/EventTrigger.h
===================================================================
--- code/branches/pickup/src/modules/objects/triggers/EventTrigger.h	(revision 5815)
+++ code/branches/pickup/src/modules/objects/triggers/EventTrigger.h	(revision 5935)
@@ -41,5 +41,5 @@
             virtual ~EventTrigger();
 
-            virtual void processEvent(Event& event);
+            virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
 
             inline void trigger(bool bTriggered)
Index: code/branches/pickup/src/modules/objects/triggers/Trigger.cc
===================================================================
--- code/branches/pickup/src/modules/objects/triggers/Trigger.cc	(revision 5815)
+++ code/branches/pickup/src/modules/objects/triggers/Trigger.cc	(revision 5935)
@@ -72,5 +72,5 @@
     }
 
-    this->setObjectMode(0x0);
+    this->setSyncMode(0x0);
   }
 
Index: code/branches/pickup/src/modules/overlays/FadeoutText.cc
===================================================================
--- code/branches/pickup/src/modules/overlays/FadeoutText.cc	(revision 5815)
+++ code/branches/pickup/src/modules/overlays/FadeoutText.cc	(revision 5935)
@@ -46,5 +46,5 @@
 
         this->bFadingOut_ = false;
-        this->fadeouttimer_.setTimer(3.0f, false, this, createExecutor(createFunctor(&FadeoutText::fadeout)));
+        this->fadeouttimer_.setTimer(3.0f, false, createExecutor(createFunctor(&FadeoutText::fadeout, this)));
         this->fadeouttimer_.stopTimer();
 
Index: code/branches/pickup/src/modules/overlays/FadeoutText.h
===================================================================
--- code/branches/pickup/src/modules/overlays/FadeoutText.h	(revision 5815)
+++ code/branches/pickup/src/modules/overlays/FadeoutText.h	(revision 5935)
@@ -68,5 +68,5 @@
 
             bool bFadingOut_;
-            Timer<FadeoutText> fadeouttimer_;
+            Timer fadeouttimer_;
 
             float initialAlpha_;
Index: code/branches/pickup/src/modules/overlays/OverlaysPrereqs.h
===================================================================
--- code/branches/pickup/src/modules/overlays/OverlaysPrereqs.h	(revision 5815)
+++ code/branches/pickup/src/modules/overlays/OverlaysPrereqs.h	(revision 5935)
@@ -28,6 +28,7 @@
 
 /**
-  @file
-  @brief Contains all the necessary forward declarations for all classes and structs.
+@file
+@brief
+    Shared library macros, enums, constants and forward declarations for the overlays module
 */
 
@@ -36,8 +37,10 @@
 
 #include "OrxonoxConfig.h"
+#include "OrxonoxPrereqs.h"
 
 //-----------------------------------------------------------------------
 // Shared library settings
 //-----------------------------------------------------------------------
+
 #if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(ORXONOX_STATIC_BUILD)
 #  ifdef OVERLAYS_SHARED_BUILD
@@ -62,23 +65,29 @@
 namespace orxonox
 {
-    class BarColour;
+    class FadeoutText;
+    class GUIOverlay;
+    class OverlayText;
+
+    // debugging
     class DebugFPSText;
     class DebugRTRText;
-    class GUIOverlay;
+
+    // hud
+    class AnnounceMessage;
+    class BarColour;
+    class ChatOverlay;
+    class DeathMessage;
+    class GametypeStatus;
     class HUDBar;
+    class HUDHealthBar;
     class HUDNavigation;
     class HUDRadar;
     class HUDSpeedBar;
-    class HUDHealthBar;
     class HUDTimer;
-    class OrxonoxOverlay;
-    class OverlayGroup;
-    class OverlayText;
-    class FadeoutText;
-    class GametypeStatus;
-    class AnnounceMessage;
     class KillMessage;
-    class DeathMessage;
+    class TeamBaseMatchScore;
+    class UnderAttackHealthBar;
 
+    // stats
     class CreateLines;
     class Scoreboard;
Index: code/branches/pickup/src/modules/overlays/hud/ChatOverlay.cc
===================================================================
--- code/branches/pickup/src/modules/overlays/hud/ChatOverlay.cc	(revision 5815)
+++ code/branches/pickup/src/modules/overlays/hud/ChatOverlay.cc	(revision 5935)
@@ -58,4 +58,6 @@
     ChatOverlay::~ChatOverlay()
     {
+        for (std::set<Timer*>::iterator it = this->timers_.begin(); it != this->timers_.end(); ++it)
+            delete (*it);
     }
 
@@ -87,14 +89,19 @@
         COUT(0) << "Chat: " << text << std::endl;
 
-        new Timer<ChatOverlay>(this->displayTime_, false, this, createExecutor(createFunctor(&ChatOverlay::dropMessage)), true);
+        Timer* timer = new Timer();
+        this->timers_.insert(timer); // store the timer in a set to destroy it in the destructor
+        Executor* executor = createExecutor(createFunctor(&ChatOverlay::dropMessage, this));
+        executor->setDefaultValues(timer);
+        timer->setTimer(this->displayTime_, false, executor, true);
 
         this->updateOverlayText();
     }
 
-    void ChatOverlay::dropMessage()
+    void ChatOverlay::dropMessage(Timer* timer)
     {
         if (this->messages_.size() > 0)
             this->messages_.pop_front();
         this->updateOverlayText();
+        this->timers_.erase(timer); // the timer destroys itself, but we have to remove it from the set
     }
 
Index: code/branches/pickup/src/modules/overlays/hud/ChatOverlay.h
===================================================================
--- code/branches/pickup/src/modules/overlays/hud/ChatOverlay.h	(revision 5815)
+++ code/branches/pickup/src/modules/overlays/hud/ChatOverlay.h	(revision 5935)
@@ -55,7 +55,8 @@
         private:
             void updateOverlayText();
-            void dropMessage();
+            void dropMessage(Timer* timer);
 
             float displayTime_;
+            std::set<Timer*> timers_;
     };
 }
Index: code/branches/pickup/src/modules/overlays/hud/HUDBar.cc
===================================================================
--- code/branches/pickup/src/modules/overlays/hud/HUDBar.cc	(revision 5815)
+++ code/branches/pickup/src/modules/overlays/hud/HUDBar.cc	(revision 5935)
@@ -96,5 +96,9 @@
     {
         if (this->isInitialized())
+        {
             Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->bar_);
+            for (std::vector<BarColour*>::const_iterator it = this->barColours_.begin(); it != this->barColours_.end(); )
+                (*it++)->destroy();
+        }
     }
 
Index: code/branches/pickup/src/modules/overlays/hud/HUDHealthBar.cc
===================================================================
--- code/branches/pickup/src/modules/overlays/hud/HUDHealthBar.cc	(revision 5815)
+++ code/branches/pickup/src/modules/overlays/hud/HUDHealthBar.cc	(revision 5935)
@@ -56,5 +56,5 @@
     {
         if (this->isInitialized())
-            delete this->textoverlay_;
+            this->textoverlay_->destroy();
     }
 
@@ -84,4 +84,9 @@
             this->setValue(this->owner_->getHealth() / this->owner_->getInitialHealth());
             this->textoverlay_->setCaption(multi_cast<std::string>(static_cast<int>(this->owner_->getHealth())));
+        }
+        else
+        {
+            this->setValue(0);
+            this->textoverlay_->setCaption("0");
         }
 
Index: code/branches/pickup/src/modules/overlays/hud/HUDHealthBar.h
===================================================================
--- code/branches/pickup/src/modules/overlays/hud/HUDHealthBar.h	(revision 5815)
+++ code/branches/pickup/src/modules/overlays/hud/HUDHealthBar.h	(revision 5935)
@@ -111,5 +111,5 @@
 
         private:
-            Pawn* owner_;
+            WeakPtr<Pawn> owner_;
             OverlayText* textoverlay_;
             bool bUseBarColour_;
Index: code/branches/pickup/src/modules/overlays/hud/HUDNavigation.cc
===================================================================
--- code/branches/pickup/src/modules/overlays/hud/HUDNavigation.cc	(revision 5815)
+++ code/branches/pickup/src/modules/overlays/hud/HUDNavigation.cc	(revision 5935)
@@ -39,4 +39,5 @@
 #include "core/CoreIncludes.h"
 #include "core/XMLPort.h"
+#include "Scene.h"
 #include "Radar.h"
 
@@ -130,5 +131,8 @@
         SUPER(HUDNavigation, tick, dt);
 
-        if (!Radar::getInstance().getFocus())
+        // Get radar
+        Radar* radar = this->getOwner()->getScene()->getRadar();
+
+        if (!radar->getFocus())
         {
             this->overlay_->hide();
@@ -150,5 +154,5 @@
 */
         // transform to screen coordinates
-        Vector3 pos = /*transformationMatrix * */Radar::getInstance().getFocus()->getRVWorldPosition();
+        Vector3 pos = /*transformationMatrix * */radar->getFocus()->getRVWorldPosition();
 
         bool outOfView;
Index: code/branches/pickup/src/modules/overlays/hud/TeamBaseMatchScore.cc
===================================================================
--- code/branches/pickup/src/modules/overlays/hud/TeamBaseMatchScore.cc	(revision 5815)
+++ code/branches/pickup/src/modules/overlays/hud/TeamBaseMatchScore.cc	(revision 5935)
@@ -118,5 +118,5 @@
 
         if (this->getOwner() && this->getOwner()->getGametype())
-            this->owner_ = orxonox_cast<TeamBaseMatch*>(this->getOwner()->getGametype());
+            this->owner_ = orxonox_cast<TeamBaseMatch*>(this->getOwner()->getGametype().get());
         else
             this->owner_ = 0;
Index: code/branches/pickup/src/modules/overlays/hud/UnderAttackHealthBar.cc
===================================================================
--- code/branches/pickup/src/modules/overlays/hud/UnderAttackHealthBar.cc	(revision 5815)
+++ code/branches/pickup/src/modules/overlays/hud/UnderAttackHealthBar.cc	(revision 5935)
@@ -52,5 +52,5 @@
         this->text_->setPickPoint(Vector2(0.5, 0));
 
-        this->inittimer_.setTimer(0.0f, false, this, createExecutor(createFunctor(&UnderAttackHealthBar::init)));
+        this->inittimer_.setTimer(0.0f, false, createExecutor(createFunctor(&UnderAttackHealthBar::init, this)));
     }
 
@@ -58,5 +58,5 @@
     {
         if (this->isInitialized())
-            delete this->text_;
+            this->text_->destroy();
     }
 
@@ -78,5 +78,5 @@
             this->owner_ = player;
 
-            UnderAttack* ua = orxonox_cast<UnderAttack*>(player->getGametype());
+            UnderAttack* ua = orxonox_cast<UnderAttack*>(player->getGametype().get());
             if (ua)
             {
Index: code/branches/pickup/src/modules/overlays/hud/UnderAttackHealthBar.h
===================================================================
--- code/branches/pickup/src/modules/overlays/hud/UnderAttackHealthBar.h	(revision 5815)
+++ code/branches/pickup/src/modules/overlays/hud/UnderAttackHealthBar.h	(revision 5935)
@@ -62,5 +62,5 @@
             PlayerInfo* owner_;
             OverlayText* text_;
-            Timer<UnderAttackHealthBar> inittimer_;
+            Timer inittimer_;
     };
 }
Index: code/branches/pickup/src/modules/overlays/stats/CreateLines.cc
===================================================================
--- code/branches/pickup/src/modules/overlays/stats/CreateLines.cc	(revision 5815)
+++ code/branches/pickup/src/modules/overlays/stats/CreateLines.cc	(revision 5935)
@@ -59,8 +59,8 @@
     CreateLines::~CreateLines()
     {
-        delete this->playerNameText_;
-        delete this->scoreText_;
-        delete this->deathsText_;
-        delete this->background_;
+        this->playerNameText_->destroy();
+        this->scoreText_->destroy();
+        this->deathsText_->destroy();
+        this->background_->destroy();
     }
 
Index: code/branches/pickup/src/modules/overlays/stats/Scoreboard.cc
===================================================================
--- code/branches/pickup/src/modules/overlays/stats/Scoreboard.cc	(revision 5815)
+++ code/branches/pickup/src/modules/overlays/stats/Scoreboard.cc	(revision 5935)
@@ -44,4 +44,14 @@
     {
         RegisterObject(Scoreboard);
+    }
+
+    Scoreboard::~Scoreboard()
+    {
+        while (this->lines_.size() > 0)
+        {
+            // destroy lines
+            delete this->lines_.back();
+            this->lines_.pop_back();
+        }
     }
 
Index: code/branches/pickup/src/modules/overlays/stats/Scoreboard.h
===================================================================
--- code/branches/pickup/src/modules/overlays/stats/Scoreboard.h	(revision 5815)
+++ code/branches/pickup/src/modules/overlays/stats/Scoreboard.h	(revision 5935)
@@ -42,5 +42,5 @@
     public: // functions
         Scoreboard(BaseObject* creator);
-        virtual ~Scoreboard() {}
+        virtual ~Scoreboard();
 
         virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
Index: code/branches/pickup/src/modules/pong/CMakeLists.txt
===================================================================
--- code/branches/pickup/src/modules/pong/CMakeLists.txt	(revision 5815)
+++ code/branches/pickup/src/modules/pong/CMakeLists.txt	(revision 5935)
@@ -1,3 +1,4 @@
 SET_SOURCE_FILES(PONG_SRC_FILES
+COMPILATION_BEGIN PongCompilation.cc
   Pong.cc
   PongAI.cc
@@ -7,4 +8,5 @@
   PongCenterpoint.cc
   PongScore.cc
+COMPILATION_END
 )
 
@@ -12,7 +14,4 @@
   MODULE
   FIND_HEADER_FILES
-  PCH_FILE
-    PongPrecompiledHeaders.h
-  PCH_NO_DEFAULT
   DEFINE_SYMBOL
     "PONG_SHARED_BUILD"
Index: code/branches/pickup/src/modules/pong/Pong.cc
===================================================================
--- code/branches/pickup/src/modules/pong/Pong.cc	(revision 5815)
+++ code/branches/pickup/src/modules/pong/Pong.cc	(revision 5935)
@@ -30,4 +30,5 @@
 
 #include "core/CoreIncludes.h"
+#include "core/EventIncludes.h"
 #include "core/Executor.h"
 #include "PongCenterpoint.h"
@@ -39,4 +40,7 @@
 namespace orxonox
 {
+    CreateEventName(PongCenterpoint, right);
+    CreateEventName(PongCenterpoint, left);
+    
     CreateUnloadableFactory(Pong);
 
@@ -52,5 +56,5 @@
         this->setHUDTemplate("PongHUD");
 
-        this->starttimer_.setTimer(1.0, false, this, createExecutor(createFunctor(&Pong::startBall)));
+        this->starttimer_.setTimer(1.0, false, createExecutor(createFunctor(&Pong::startBall, this)));
         this->starttimer_.stopTimer();
 
@@ -72,4 +76,5 @@
             this->ball_->setFieldDimension(this->center_->getFieldDimension());
             this->ball_->setSpeed(0);
+            this->ball_->setAccelerationFactor(this->center_->getBallAccelerationFactor());
             this->ball_->setBatLength(this->center_->getBatLength());
 
@@ -120,5 +125,5 @@
         if (this->ball_)
         {
-            delete this->ball_;
+            this->ball_->destroy();
             this->ball_ = 0;
         }
@@ -155,8 +160,11 @@
         if (this->center_)
         {
-            this->center_->fireEvent();
-
+            if (player == this->getRightPlayer())
+                this->center_->fireEvent(FireEventName(PongCenterpoint, right));
+            else if (player == this->getLeftPlayer())
+                this->center_->fireEvent(FireEventName(PongCenterpoint, left));
+            
             if (player)
-                this->gtinfo_.sendAnnounceMessage(player->getName() + " scored");
+                this->gtinfo_->sendAnnounceMessage(player->getName() + " scored");
         }
 
@@ -165,4 +173,5 @@
             this->ball_->setPosition(Vector3::ZERO);
             this->ball_->setVelocity(Vector3::ZERO);
+            this->ball_->setAcceleration(Vector3::ZERO);
             this->ball_->setSpeed(0);
         }
Index: code/branches/pickup/src/modules/pong/Pong.h
===================================================================
--- code/branches/pickup/src/modules/pong/Pong.h	(revision 5815)
+++ code/branches/pickup/src/modules/pong/Pong.h	(revision 5935)
@@ -62,5 +62,5 @@
             PongBall* ball_;
             PongBat* bat_[2];
-            Timer<Pong> starttimer_;
+            Timer starttimer_;
     };
 }
Index: code/branches/pickup/src/modules/pong/PongAI.cc
===================================================================
--- code/branches/pickup/src/modules/pong/PongAI.cc	(revision 5815)
+++ code/branches/pickup/src/modules/pong/PongAI.cc	(revision 5935)
@@ -49,4 +49,5 @@
         this->ballEndPosition_ = 0;
         this->randomOffset_ = 0;
+        this->bChangedRandomOffset_ = false;
         this->relHysteresisOffset_ = 0.02f;
         this->strength_ = 0.5f;
@@ -60,6 +61,6 @@
     PongAI::~PongAI()
     {
-        for (std::list<std::pair<Timer<PongAI>*, char> >::iterator it = this->reactionTimers_.begin(); it != this->reactionTimers_.end(); ++it)
-            delete (*it).first;
+        for (std::list<std::pair<Timer*, char> >::iterator it = this->reactionTimers_.begin(); it != this->reactionTimers_.end(); ++it)
+            (*it).first->destroy();
     }
 
@@ -113,4 +114,5 @@
                 this->ballEndPosition_ = 0;
                 this->randomOffset_ = 0;
+                this->bChangedRandomOffset_ = false;
 
                 this->calculateRandomOffset();
@@ -129,4 +131,16 @@
                 this->bOscillationAvoidanceActive_ = false;
             }
+            
+            // If the ball is close enough, calculate another random offset to accelerate the ball
+            if (!this->bChangedRandomOffset_)
+            {
+                float timetohit = (-this->ball_->getPosition().x + this->ball_->getFieldDimension().x / 2 * sgn(this->ball_->getVelocity().x)) / this->ball_->getVelocity().x;
+                if (timetohit < 0.05)
+                {
+                    this->bChangedRandomOffset_ = true;
+                    if (rnd() < this->strength_)
+                        this->calculateRandomOffset();
+                }
+            }
 
             // Move to the predicted end position with an additional offset (to hit the ball with the side of the bat)
@@ -184,31 +198,98 @@
         Vector3 position = this->ball_->getPosition();
         Vector3 velocity = this->ball_->getVelocity();
+        Vector3 acceleration = this->ball_->getAcceleration();
         Vector2 dimension = this->ball_->getFieldDimension();
 
-        // calculate end-height: current height + slope * distance
-        this->ballEndPosition_ = position.z + velocity.z / velocity.x * (-position.x + dimension.x / 2 * sgn(velocity.x));
-
-        // Calculate bounces
-        for (float limit = 0.35f; limit < this->strength_ || this->strength_ > 0.99f; limit += 0.4f)
-        {
-            // Calculate a random prediction error, based on the vertical speed of the ball and the strength of the AI
-            float randomError = rnd(-1, 1) * dimension.y * (velocity.z / velocity.x / PongBall::MAX_REL_Z_VELOCITY) * (1 - this->strength_);
-
-            // Bounce from the lower bound
-            if (this->ballEndPosition_ > dimension.y / 2)
-            {
-                // Mirror the predicted position at the upper bound and add some random error
-                this->ballEndPosition_ = dimension.y - this->ballEndPosition_ + randomError;
-                continue;
-            }
-            // Bounce from the upper bound
-            if (this->ballEndPosition_ < -dimension.y / 2)
-            {
-                // Mirror the predicted position at the lower bound and add some random error
-                this->ballEndPosition_ = -dimension.y - this->ballEndPosition_ + randomError;
-                continue;
-            }
-            // No bounce - break
-            break;
+        // Calculate bounces. The number of predicted bounces is limited by the AIs strength
+        for (float limit = -0.05f; limit < this->strength_ || this->strength_ > 0.99f; limit += 0.4f)
+        {
+            // calculate the time until the ball reaches the other side
+            float totaltime = (-position.x + dimension.x / 2 * sgn(velocity.x)) / velocity.x;
+            
+            // calculate wall bounce position (four possible solutions of the equation: pos.z + vel.z*t + acc.z/2*t^2 = +/- dim.z/2)
+            float bouncetime = totaltime;
+            bool bUpperWall = false;
+            
+            if (acceleration.z == 0)
+            {
+                if (velocity.z > 0)
+                {
+                    bUpperWall = true;
+                    bouncetime = (dimension.y/2 - position.z) / velocity.z;
+                }
+                else if (velocity.z < 0)
+                {
+                    bUpperWall = false;
+                    bouncetime = (-dimension.y/2 - position.z) / velocity.z;
+                }
+            }
+            else
+            {
+                // upper wall
+                float temp = velocity.z*velocity.z + 2*acceleration.z*(dimension.y/2 - position.z);
+                if (temp >= 0)
+                {
+                    float t1 = (sqrt(temp) - velocity.z) / acceleration.z;
+                    float t2 = (sqrt(temp) + velocity.z) / acceleration.z * (-1);
+                    if (t1 > 0 && t1 < bouncetime)
+                    {
+                        bouncetime = t1;
+                        bUpperWall = true;
+                    }
+                    if (t2 > 0 && t2 < bouncetime)
+                    {
+                        bouncetime = t2;
+                        bUpperWall = true;
+                    }
+                }
+                // lower wall
+                temp = velocity.z*velocity.z - 2*acceleration.z*(dimension.y/2 + position.z);
+                if (temp >= 0)
+                {
+                    float t1 = (sqrt(temp) - velocity.z) / acceleration.z;
+                    float t2 = (sqrt(temp) + velocity.z) / acceleration.z * (-1);
+                    if (t1 > 0 && t1 < bouncetime)
+                    {
+                        bouncetime = t1;
+                        bUpperWall = false;
+                    }
+                    if (t2 > 0 && t2 < bouncetime)
+                    {
+                        bouncetime = t2;
+                        bUpperWall = false;
+                    }
+                }
+            }
+
+            if (bouncetime < totaltime)
+            {
+                // Calculate a random prediction error, based on the vertical speed of the ball and the strength of the AI
+                float randomErrorX = rnd(-1, 1) * dimension.y * (velocity.z / velocity.x / PongBall::MAX_REL_Z_VELOCITY) * (1 - this->strength_);
+                float randomErrorZ = rnd(-1, 1) * dimension.y * (velocity.z / velocity.x / PongBall::MAX_REL_Z_VELOCITY) * (1 - this->strength_);
+
+                // ball bounces after <bouncetime> seconds, update the position and continue
+                velocity.z = velocity.z + acceleration.z * bouncetime;
+                
+                if (bUpperWall)
+                {
+                    position.z = dimension.y / 2;
+                    velocity.z = -fabs(velocity.z) + fabs(randomErrorZ);
+                }
+                else
+                {
+                    position.z = -dimension.y / 2;
+                    velocity.z = fabs(velocity.z) - fabs(randomErrorZ);
+                }
+                    
+                position.x = position.x + velocity.x * bouncetime + randomErrorX;
+                this->ballEndPosition_ = position.z;
+            }
+            else
+            {
+                // ball doesn't bounce, calculate the end position and return
+                // calculate end-height: current height + slope * distance incl. acceleration
+                this->ballEndPosition_ = position.z + velocity.z * totaltime + acceleration.z / 2 * totaltime * totaltime;
+                return;
+            }
         }
     }
@@ -231,6 +312,6 @@
 
             // Add a new Timer
-            Timer<PongAI>* timer = new Timer<PongAI>(delay, false, this, createExecutor(createFunctor(&PongAI::delayedMove)));
-            this->reactionTimers_.push_back(std::pair<Timer<PongAI>*, char>(timer, direction));
+            Timer* timer = new Timer(delay, false, createExecutor(createFunctor(&PongAI::delayedMove, this)));
+            this->reactionTimers_.push_back(std::pair<Timer*, char>(timer, direction));
         }
         else
@@ -246,6 +327,6 @@
 
         // Destroy the timer and remove it from the list
-        Timer<PongAI>* timer = this->reactionTimers_.front().first;
-        delete timer;
+        Timer* timer = this->reactionTimers_.front().first;
+        timer->destroy();
 
         this->reactionTimers_.pop_front();
Index: code/branches/pickup/src/modules/pong/PongAI.h
===================================================================
--- code/branches/pickup/src/modules/pong/PongAI.h	(revision 5815)
+++ code/branches/pickup/src/modules/pong/PongAI.h	(revision 5935)
@@ -62,8 +62,9 @@
             float ballEndPosition_;
             float randomOffset_;
+            bool bChangedRandomOffset_;
             float relHysteresisOffset_;
             float strength_;
 
-            std::list<std::pair<Timer<PongAI>*, char> > reactionTimers_;
+            std::list<std::pair<Timer*, char> > reactionTimers_;
             char movement_;
             char oldMove_;
Index: code/branches/pickup/src/modules/pong/PongBall.cc
===================================================================
--- code/branches/pickup/src/modules/pong/PongBall.cc	(revision 5815)
+++ code/branches/pickup/src/modules/pong/PongBall.cc	(revision 5935)
@@ -33,5 +33,4 @@
 #include "gametypes/Gametype.h"
 #include "PongBat.h"
-#include "sound/SoundBase.h"
 
 namespace orxonox
@@ -41,9 +40,11 @@
     const float PongBall::MAX_REL_Z_VELOCITY = 1.5;
 
-    PongBall::PongBall(BaseObject* creator) : MovableEntity(creator)
+    PongBall::PongBall(BaseObject* creator)
+        : MovableEntity(creator)
     {
         RegisterObject(PongBall);
 
         this->speed_ = 0;
+        this->accelerationFactor_ = 1.0f;
         this->bat_ = 0;
         this->batID_ = new unsigned int[2];
@@ -53,13 +54,8 @@
 
         this->registerVariables();
+    }
 
-        this->sidesound_ = new SoundBase(this);
-        this->sidesound_->loadFile("sounds/pong_side.wav");
-
-        this->batsound_ = new SoundBase(this);
-        this->batsound_->loadFile("sounds/pong_bat.wav");
-
-        this->scoresound_ = new SoundBase(this);
-        this->scoresound_->loadFile("sounds/pong_score.wav");
+    PongBall::~PongBall()
+    {
     }
 
@@ -79,126 +75,76 @@
         SUPER(PongBall, tick, dt);
 
-        if (GameMode::isMaster())
+        Vector3 position = this->getPosition();
+        Vector3 velocity = this->getVelocity();
+        Vector3 acceleration = this->getAcceleration();
+
+        if (position.z > this->fieldHeight_ / 2 || position.z < -this->fieldHeight_ / 2)
         {
-            Vector3 position = this->getPosition();
-            Vector3 velocity = this->getVelocity();
+            velocity.z = -velocity.z;
+            if (position.z > this->fieldHeight_ / 2)
+                position.z = this->fieldHeight_ / 2;
+            if (position.z < -this->fieldHeight_ / 2)
+                position.z = -this->fieldHeight_ / 2;
 
-            if (position.z > this->fieldHeight_ / 2 || position.z < -this->fieldHeight_ / 2)
+            this->fireEvent();
+        }
+
+        if (position.x > this->fieldWidth_ / 2 || position.x < -this->fieldWidth_ / 2)
+        {
+            float distance = 0;
+
+            if (this->bat_)
             {
-                velocity.z = -velocity.z;
-                this->sidesound_->play();
-
-                if (position.z > this->fieldHeight_ / 2)
-                    position.z = this->fieldHeight_ / 2;
-                if (position.z < -this->fieldHeight_ / 2)
-                    position.z = -this->fieldHeight_ / 2;
-            }
-
-            if (position.x > this->fieldWidth_ / 2 || position.x < -this->fieldWidth_ / 2)
-            {
-                float distance = 0;
-
-                if (this->bat_)
+                if (position.x > this->fieldWidth_ / 2 && this->bat_[1])
                 {
-                    if (position.x > this->fieldWidth_ / 2 && this->bat_[1])
+                    distance = (position.z - this->bat_[1]->getPosition().z) / (this->fieldHeight_ * (this->batlength_ * 1.10f) / 2);
+                    if (fabs(distance) <= 1)
                     {
-                        distance = (position.z - this->bat_[1]->getPosition().z) / (this->fieldHeight_ * (this->batlength_ * 1.10f) / 2);
-                        if (fabs(distance) <= 1)
+                        position.x = this->fieldWidth_ / 2;
+                        velocity.x = -velocity.x;
+                        velocity.z = distance * distance * sgn(distance) * PongBall::MAX_REL_Z_VELOCITY * this->speed_;
+                        acceleration = this->bat_[1]->getVelocity() * this->accelerationFactor_ * -1;
+                        
+                        this->fireEvent();
+                    }
+                    else if (GameMode::isMaster() && position.x > this->fieldWidth_ / 2 * (1 + this->relMercyOffset_))
+                    {
+                        if (this->getGametype() && this->bat_[0])
                         {
-                            position.x = this->fieldWidth_ / 2;
-                            velocity.x = -velocity.x;
-                            velocity.z = distance * distance * sgn(distance) * PongBall::MAX_REL_Z_VELOCITY * this->speed_;
-                            this->batsound_->play();
-                        }
-                        else if (position.x > this->fieldWidth_ / 2 * (1 + this->relMercyOffset_))
-                        {
-                            if (this->getGametype() && this->bat_[0])
-                            {
-                                this->getGametype()->playerScored(this->bat_[0]->getPlayer());
-                                this->scoresound_->play();
-                                return;
-                            }
+                            this->getGametype()->playerScored(this->bat_[0]->getPlayer());
+                            return;
                         }
                     }
-                    if (position.x < -this->fieldWidth_ / 2 && this->bat_[0])
+                }
+                if (position.x < -this->fieldWidth_ / 2 && this->bat_[0])
+                {
+                    distance = (position.z - this->bat_[0]->getPosition().z) / (this->fieldHeight_ * (this->batlength_ * 1.10f) / 2);
+                    if (fabs(distance) <= 1)
                     {
-                        distance = (position.z - this->bat_[0]->getPosition().z) / (this->fieldHeight_ * (this->batlength_ * 1.10f) / 2);
-                        if (fabs(distance) <= 1)
+                        position.x = -this->fieldWidth_ / 2;
+                        velocity.x = -velocity.x;
+                        velocity.z = distance * distance * sgn(distance) * PongBall::MAX_REL_Z_VELOCITY * this->speed_;
+                        acceleration = this->bat_[0]->getVelocity() * this->accelerationFactor_ * -1;
+
+                        this->fireEvent();
+                    }
+                    else if (GameMode::isMaster() && position.x < -this->fieldWidth_ / 2 * (1 + this->relMercyOffset_))
+                    {
+                        if (this->getGametype() && this->bat_[1])
                         {
-                            position.x = -this->fieldWidth_ / 2;
-                            velocity.x = -velocity.x;
-                            velocity.z = distance * distance * sgn(distance) * PongBall::MAX_REL_Z_VELOCITY * this->speed_;
-                            this->batsound_->play();
-                        }
-                        else if (position.x < -this->fieldWidth_ / 2 * (1 + this->relMercyOffset_))
-                        {
-                            if (this->getGametype() && this->bat_[1])
-                            {
-                                this->scoresound_->play();
-                                this->getGametype()->playerScored(this->bat_[1]->getPlayer());
-                                return;
-                            }
+                            this->getGametype()->playerScored(this->bat_[1]->getPlayer());
+                            return;
                         }
                     }
                 }
             }
+        }
 
-            if (velocity != this->getVelocity())
-                this->setVelocity(velocity);
-            if (position != this->getPosition())
-                this->setPosition(position);
-        }
-        else
-        {
-          Vector3 position = this->getPosition();
-          Vector3 velocity = this->getVelocity();
-
-          if (position.z > this->fieldHeight_ / 2 || position.z < -this->fieldHeight_ / 2)
-          {
-            velocity.z = -velocity.z;
-            this->sidesound_->play();
-
-            if (position.z > this->fieldHeight_ / 2)
-              position.z = this->fieldHeight_ / 2;
-            if (position.z < -this->fieldHeight_ / 2)
-              position.z = -this->fieldHeight_ / 2;
-          }
-
-          if (position.x > this->fieldWidth_ / 2 || position.x < -this->fieldWidth_ / 2)
-          {
-            float distance = 0;
-
-            if (this->bat_)
-            {
-              if (position.x > this->fieldWidth_ / 2 && this->bat_[1])
-              {
-                distance = (position.z - this->bat_[1]->getPosition().z) / (this->fieldHeight_ * (this->batlength_ * 1.10f) / 2);
-                if (fabs(distance) <= 1)
-                {
-                  position.x = this->fieldWidth_ / 2;
-                  velocity.x = -velocity.x;
-                  this->batsound_->play();
-                  velocity.z = distance * distance * sgn(distance) * PongBall::MAX_REL_Z_VELOCITY * this->speed_;
-                }
-              }
-              if (position.x < -this->fieldWidth_ / 2 && this->bat_[0])
-              {
-                distance = (position.z - this->bat_[0]->getPosition().z) / (this->fieldHeight_ * (this->batlength_ * 1.10f) / 2);
-                if (fabs(distance) <= 1)
-                {
-                  position.x = -this->fieldWidth_ / 2;
-                  velocity.x = -velocity.x;
-                  this->batsound_->play();
-                  velocity.z = distance * distance * sgn(distance) * PongBall::MAX_REL_Z_VELOCITY * this->speed_;
-                }
-              }
-            }
-          }
-
-          if (velocity != this->getVelocity())
+        if (acceleration != this->getAcceleration())
+            this->setAcceleration(acceleration);
+        if (velocity != this->getVelocity())
             this->setVelocity(velocity);
-          if (position != this->getPosition())
+        if (position != this->getPosition())
             this->setPosition(position);
-        }
     }
 
Index: code/branches/pickup/src/modules/pong/PongBall.h
===================================================================
--- code/branches/pickup/src/modules/pong/PongBall.h	(revision 5815)
+++ code/branches/pickup/src/modules/pong/PongBall.h	(revision 5935)
@@ -41,5 +41,5 @@
         public:
             PongBall(BaseObject* creator);
-            virtual ~PongBall() {}
+            virtual ~PongBall();
 
             virtual void tick(float dt);
@@ -58,4 +58,9 @@
                 { return this->speed_; }
 
+            void setAccelerationFactor(float factor)
+                { this->accelerationFactor_ = factor; }
+            float getAccelerationFactor() const
+                { return this->accelerationFactor_; }
+
             void setBatLength(float batlength)
                 { this->batlength_ = batlength; }
@@ -72,12 +77,9 @@
             float fieldHeight_;
             float speed_;
+            float accelerationFactor_;
             float batlength_;
             PongBat** bat_;
             unsigned int* batID_;
             float relMercyOffset_;
-
-            SoundBase* sidesound_;
-            SoundBase* batsound_;
-            SoundBase* scoresound_;
     };
 }
Index: code/branches/pickup/src/modules/pong/PongCenterpoint.cc
===================================================================
--- code/branches/pickup/src/modules/pong/PongCenterpoint.cc	(revision 5815)
+++ code/branches/pickup/src/modules/pong/PongCenterpoint.cc	(revision 5935)
@@ -44,4 +44,5 @@
         this->height_ = 120;
         this->ballspeed_ = 100;
+        this->ballaccfactor_ = 1.0;
         this->batspeed_ = 60;
         this->batlength_ = 0.25;
@@ -58,4 +59,5 @@
         XMLPortParam(PongCenterpoint, "battemplate", setBattemplate, getBattemplate, xmlelement, mode);
         XMLPortParam(PongCenterpoint, "ballspeed", setBallSpeed, getBallSpeed, xmlelement, mode);
+        XMLPortParam(PongCenterpoint, "ballaccfactor", setBallAccelerationFactor, getBallAccelerationFactor, xmlelement, mode);
         XMLPortParam(PongCenterpoint, "batspeed", setBatSpeed, getBatSpeed, xmlelement, mode);
         XMLPortParam(PongCenterpoint, "batlength", setBatLength, getBatLength, xmlelement, mode);
@@ -73,5 +75,5 @@
         if (this->getGametype() && this->getGametype()->isA(Class(Pong)))
         {
-            Pong* pong_gametype = orxonox_cast<Pong*>(this->getGametype());
+            Pong* pong_gametype = orxonox_cast<Pong*>(this->getGametype().get());
             pong_gametype->setCenterpoint(this);
         }
Index: code/branches/pickup/src/modules/pong/PongCenterpoint.h
===================================================================
--- code/branches/pickup/src/modules/pong/PongCenterpoint.h	(revision 5815)
+++ code/branches/pickup/src/modules/pong/PongCenterpoint.h	(revision 5935)
@@ -68,4 +68,9 @@
                 { return this->ballspeed_; }
 
+            void setBallAccelerationFactor(float ballaccfactor)
+                { this->ballaccfactor_ = ballaccfactor; }
+            float getBallAccelerationFactor() const
+                { return this->ballaccfactor_; }
+
             void setBatSpeed(float batspeed)
                 { this->batspeed_ = batspeed; }
@@ -85,4 +90,5 @@
 
             float ballspeed_;
+            float ballaccfactor_;
             float batspeed_;
             float batlength_;
Index: code/branches/pickup/src/modules/pong/PongPrecompiledHeaders.h
===================================================================
--- code/branches/pickup/src/modules/pong/PongPrecompiledHeaders.h	(revision 5815)
+++ 	(revision )
@@ -1,58 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Reto Grieder
- *   Co-authors:
- *      ...
- *
- */
-
-/**
-@file
-@brief
-    Compilation of the most often used header files in the pong module
-@details
-    Updated: 19. September 2009
-    Total Files: 7
-*/
-
-#include "OrxonoxConfig.h"
-
-///////////////////////////////////////////
-/////          Stable Headers         /////
-///////////////////////////////////////////
-
-#include "util/OgreForwardRefs.h" // 6
-
-///////////////////////////////////////////
-/////       All Rebuild Headers       /////
-///////////////////////////////////////////
-
-#include "core/BaseObject.h"   // 7
-#include "core/CoreIncludes.h" // 7
-#include "core/Executor.h"     // 6
-#include "network/synchronisable/Synchronisable.h" // 7
-
-
-// Just in case some header included windows.h
-#undef min
-#undef max
Index: code/branches/pickup/src/modules/pong/PongPrereqs.h
===================================================================
--- code/branches/pickup/src/modules/pong/PongPrereqs.h	(revision 5815)
+++ code/branches/pickup/src/modules/pong/PongPrereqs.h	(revision 5935)
@@ -28,6 +28,7 @@
 
 /**
-  @file
-  @brief Contains all the necessary forward declarations for all classes and structs.
+@file
+@brief
+    Shared library macros, enums, constants and forward declarations for the pong module
 */
 
@@ -36,8 +37,10 @@
 
 #include "OrxonoxConfig.h"
+#include "OrxonoxPrereqs.h"
 
 //-----------------------------------------------------------------------
 // Shared library settings
 //-----------------------------------------------------------------------
+
 #if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(ORXONOX_STATIC_BUILD)
 #  ifdef PONG_SHARED_BUILD
Index: code/branches/pickup/src/modules/pong/PongScore.cc
===================================================================
--- code/branches/pickup/src/modules/pong/PongScore.cc	(revision 5815)
+++ code/branches/pickup/src/modules/pong/PongScore.cc	(revision 5935)
@@ -133,5 +133,5 @@
 
         if (this->getOwner() && this->getOwner()->getGametype())
-            this->owner_ = orxonox_cast<Pong*>(this->getOwner()->getGametype());
+            this->owner_ = orxonox_cast<Pong*>(this->getOwner()->getGametype().get());
         else
             this->owner_ = 0;
Index: code/branches/pickup/src/modules/questsystem/QuestEffectBeacon.cc
===================================================================
--- code/branches/pickup/src/modules/questsystem/QuestEffectBeacon.cc	(revision 5815)
+++ code/branches/pickup/src/modules/questsystem/QuestEffectBeacon.cc	(revision 5935)
@@ -75,16 +75,14 @@
         XMLPortObject(QuestEffectBeacon, QuestEffect, "effects", addEffect, getEffect, xmlelement, mode);
 
+        XMLPortEventState(QuestEffectBeacon, PlayerTrigger, "execute", execute, xmlelement, mode);
+
         COUT(3) << "New QuestEffectBeacon created." << std::endl;
     }
 
-    /**
-    @brief
-        Processes an event for this QuestEffectBeacon.
-    */
-    void QuestEffectBeacon::processEvent(Event& event)
-    {
-        SUPER(QuestEffectBeacon, processEvent, event);
-
-        ORXONOX_SET_SUBCLASS_EVENT(QuestEffectBeacon, "execute", execute, event, PlayerTrigger);
+    void QuestEffectBeacon::XMLEventPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(QuestEffectBeacon, XMLEventPort, xmlelement, mode);
+
+        XMLPortEventState(QuestEffectBeacon, PlayerTrigger, "execute", execute, xmlelement, mode);
     }
 
Index: code/branches/pickup/src/modules/questsystem/QuestEffectBeacon.h
===================================================================
--- code/branches/pickup/src/modules/questsystem/QuestEffectBeacon.h	(revision 5815)
+++ code/branches/pickup/src/modules/questsystem/QuestEffectBeacon.h	(revision 5935)
@@ -86,6 +86,5 @@
 
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestEffectBeacon object through XML.
-
-            virtual void processEvent(Event& event); //!< Processes an event for this QuestEffectBeacon.
+            virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
 
             bool execute(bool b, PlayerTrigger* trigger); //!< Executes the QuestEffects of the QuestEffectBeacon.
Index: code/branches/pickup/src/modules/questsystem/QuestGUI.cc
===================================================================
--- code/branches/pickup/src/modules/questsystem/QuestGUI.cc	(revision 5815)
+++ code/branches/pickup/src/modules/questsystem/QuestGUI.cc	(revision 5935)
@@ -79,5 +79,5 @@
         
         if(this->root_ != NULL)
-            delete this->root_;
+            this->root_->destroy();
     }
 
@@ -146,5 +146,5 @@
             COUT(3) << "Clearing Node '" << *str << "' ..." << std::endl;
             delete str;
-            delete node;
+            node->destroy();
         }
         this->nodes_.clear();
Index: code/branches/pickup/src/modules/questsystem/QuestManager.cc
===================================================================
--- code/branches/pickup/src/modules/questsystem/QuestManager.cc	(revision 5815)
+++ code/branches/pickup/src/modules/questsystem/QuestManager.cc	(revision 5935)
@@ -41,4 +41,5 @@
 #include "core/ConsoleCommand.h"
 #include "core/LuaState.h"
+#include "core/ScopedSingletonManager.h"
 #include "infos/PlayerInfo.h"
 #include "overlays/GUIOverlay.h"
@@ -56,4 +57,5 @@
     //! Pointer to the current (and single) instance of this class.
     /*static*/ QuestManager* QuestManager::singletonPtr_s = NULL;
+    ManageScopedSingleton(QuestManager, ScopeID::Root, false);
 
     /**
@@ -76,5 +78,5 @@
         for(std::map<PlayerInfo*, QuestGUI*>::iterator it = this->questGUIs_.begin(); it != this->questGUIs_.end(); it++)
         {
-            delete (*it).second;
+            (*it).second->destroy();
         }
         this->questGUIs_.clear();
Index: code/branches/pickup/src/modules/questsystem/QuestManager.h
===================================================================
--- code/branches/pickup/src/modules/questsystem/QuestManager.h	(revision 5815)
+++ code/branches/pickup/src/modules/questsystem/QuestManager.h	(revision 5935)
@@ -42,5 +42,5 @@
 #include <string>
 
-#include "util/ScopedSingleton.h"
+#include "util/Singleton.h"
 #include "core/OrxonoxClass.h"
 
@@ -50,7 +50,4 @@
 namespace orxonox
 {
-
-    typedef ScopedSingleton<QuestManager, ScopeID::GSLevel> ScopedSingletonQuestManagerGSLevel; // workaround for tolua
-
     /**
     @brief
@@ -60,9 +57,10 @@
         Damian 'Mozork' Frick
     */
-    class _QuestsystemExport QuestManager : public ScopedSingletonQuestManagerGSLevel, public orxonox::OrxonoxClass
-    {
+    class _QuestsystemExport QuestManager
 // tolua_end
+        : public Singleton<QuestManager>, public orxonox::OrxonoxClass
+    { // tolua_export
 
-            friend class ScopedSingleton<QuestManager, ScopeID::GSLevel>;
+            friend class Singleton<QuestManager>;
             friend class QuestGUI;
 
@@ -72,5 +70,5 @@
 
             //! Returns a reference to the single instance of the Quest Manager.
-            static QuestManager& getInstance() { return ScopedSingleton<QuestManager, ScopeID::GSLevel>::getInstance(); } // tolua_export
+            static QuestManager& getInstance() { return Singleton<QuestManager>::getInstance(); } // tolua_export
 
             //! Retreive the main window for the GUI. 
Index: code/branches/pickup/src/modules/questsystem/QuestsystemPrecompiledHeaders.h
===================================================================
--- code/branches/pickup/src/modules/questsystem/QuestsystemPrecompiledHeaders.h	(revision 5815)
+++ code/branches/pickup/src/modules/questsystem/QuestsystemPrecompiledHeaders.h	(revision 5935)
@@ -51,6 +51,6 @@
 #include <OgreColourValue.h> // 16
 
-#include <tinyxml/ticpp.h>        // 14
-#include "util/ScopedSingleton.h" // 13
+#include <tinyxml/ticpp.h>   // 14
+#include "util/Singleton.h"  // 13
 
 ///////////////////////////////////////////
Index: code/branches/pickup/src/modules/questsystem/QuestsystemPrereqs.h
===================================================================
--- code/branches/pickup/src/modules/questsystem/QuestsystemPrereqs.h	(revision 5815)
+++ code/branches/pickup/src/modules/questsystem/QuestsystemPrereqs.h	(revision 5935)
@@ -28,6 +28,7 @@
 
 /**
-  @file
-  @brief Contains all the necessary forward declarations for all classes and structs.
+@file
+@brief
+    Shared library macros, enums, constants and forward declarations for the questsystem module
 */
 
@@ -36,5 +37,4 @@
 
 #include "OrxonoxConfig.h"
-
 #include "OrxonoxPrereqs.h"
 
@@ -42,4 +42,5 @@
 // Shared library settings
 //-----------------------------------------------------------------------
+
 #if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(ORXONOX_STATIC_BUILD)
 #  ifdef QUESTSYSTEM_SHARED_BUILD
@@ -76,6 +77,6 @@
     class QuestEffect;
     class QuestEffectBeacon;
+    class QuestGUI;
     class QuestGUINode;
-    class QuestGUI;
     class QuestHint;
     class QuestItem;
@@ -83,8 +84,7 @@
     class QuestManager;
     class QuestNotification;
-    class Rewardable;
 
+    // notifications
     class Notification;
-    class NotificationListener;
     class NotificationManager;
     class NotificationOverlay;
Index: code/branches/pickup/src/modules/questsystem/notifications/NotificationManager.cc
===================================================================
--- code/branches/pickup/src/modules/questsystem/notifications/NotificationManager.cc	(revision 5815)
+++ code/branches/pickup/src/modules/questsystem/notifications/NotificationManager.cc	(revision 5935)
@@ -37,4 +37,5 @@
 
 #include "core/CoreIncludes.h"
+#include "core/ScopedSingletonManager.h"
 #include "Notification.h"
 #include "interfaces/NotificationListener.h"
@@ -47,4 +48,5 @@
 
     NotificationManager* NotificationManager::singletonPtr_s = NULL;
+    ManageScopedSingleton(NotificationManager, ScopeID::Root, false);
 
     /**
Index: code/branches/pickup/src/modules/questsystem/notifications/NotificationManager.h
===================================================================
--- code/branches/pickup/src/modules/questsystem/notifications/NotificationManager.h	(revision 5815)
+++ code/branches/pickup/src/modules/questsystem/notifications/NotificationManager.h	(revision 5935)
@@ -41,10 +41,9 @@
 #include <string>
 
-#include "util/ScopedSingleton.h"
+#include "util/Singleton.h"
 #include "core/OrxonoxClass.h"
 
 namespace orxonox
 {
-
     /**
     @brief
@@ -54,7 +53,7 @@
         Damian 'Mozork' Frick
     */
-    class _QuestsystemExport NotificationManager : public ScopedSingleton<NotificationManager, ScopeID::GSLevel>, public OrxonoxClass
+    class _QuestsystemExport NotificationManager : public Singleton<NotificationManager>, public OrxonoxClass
     {
-            friend class ScopedSingleton<NotificationManager, ScopeID::GSLevel>;
+            friend class Singleton<NotificationManager>;
         public:
             NotificationManager();
Index: code/branches/pickup/src/modules/questsystem/notifications/NotificationQueue.cc
===================================================================
--- code/branches/pickup/src/modules/questsystem/notifications/NotificationQueue.cc	(revision 5815)
+++ code/branches/pickup/src/modules/questsystem/notifications/NotificationQueue.cc	(revision 5935)
@@ -426,5 +426,5 @@
         this->containers_.erase(container);
         this->overlays_.erase(container->notification);
-        delete container->overlay;
+        container->overlay->destroy();
         delete container;
         this->size_= this->size_-1;
Index: code/branches/pickup/src/modules/weapons/MuzzleFlash.cc
===================================================================
--- code/branches/pickup/src/modules/weapons/MuzzleFlash.cc	(revision 5815)
+++ code/branches/pickup/src/modules/weapons/MuzzleFlash.cc	(revision 5935)
@@ -41,13 +41,6 @@
         RegisterObject(MuzzleFlash);
         this->setScale(0.1f);
-        
-        this->delayTimer_.setTimer(0.1f, false, this, createExecutor(createFunctor(&MuzzleFlash::destroy)));
 
+        this->delayTimer_.setTimer(0.1f, false, createExecutor(createFunctor(&MuzzleFlash::destroy, this)));
     }
-
-    void MuzzleFlash::destroy()
-    {
-        delete this;
-    }
- 
 }
Index: code/branches/pickup/src/modules/weapons/MuzzleFlash.h
===================================================================
--- code/branches/pickup/src/modules/weapons/MuzzleFlash.h	(revision 5815)
+++ code/branches/pickup/src/modules/weapons/MuzzleFlash.h	(revision 5935)
@@ -43,10 +43,6 @@
             virtual ~MuzzleFlash() {}
 
-
-
         private:
-            void destroy();
-            Timer<MuzzleFlash> delayTimer_;
-
+            Timer delayTimer_;
     };
 }
Index: code/branches/pickup/src/modules/weapons/WeaponsPrereqs.h
===================================================================
--- code/branches/pickup/src/modules/weapons/WeaponsPrereqs.h	(revision 5815)
+++ code/branches/pickup/src/modules/weapons/WeaponsPrereqs.h	(revision 5935)
@@ -28,6 +28,7 @@
 
 /**
-  @file
-  @brief Contains all the necessary forward declarations for all classes and structs.
+@file
+@brief
+    Shared library macros, enums, constants and forward declarations for the weapons module
 */
 
@@ -36,5 +37,4 @@
 
 #include "OrxonoxConfig.h"
-
 #include "OrxonoxPrereqs.h"
 
@@ -42,4 +42,5 @@
 // Shared library settings
 //-----------------------------------------------------------------------
+
 #if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(ORXONOX_STATIC_BUILD)
 #  ifdef WEAPONS_SHARED_BUILD
@@ -64,20 +65,23 @@
 namespace orxonox
 {
-    class LaserFire;
+    class MuzzleFlash;
+
+    // munitions
+    class FusionMunition;
+    class LaserMunition;
+    class ReplenishingMunition;
+
+    // projectiles
+    class BillboardProjectile;
+    class LightningGunProjectile;
+    class ParticleProjectile;
+    class Projectile;
+
+    // weaponmodes
+    class EnergyDrink;
     class FusionFire;
     class HsW01;
+    class LaserFire;
     class LightningGun;
-    class EnergyDrink;
-
-    class Projectile;
-    class BillboardProjectile;
-    class ParticleProjectile;
-    class LightningGunProjectile;
-
-    class ReplenishingMunition;
-    class LaserMunition;
-    class FusionMunition;
-
-    class MuzzleFlash;
 }
 
Index: code/branches/pickup/src/modules/weapons/munitions/ReplenishingMunition.cc
===================================================================
--- code/branches/pickup/src/modules/weapons/munitions/ReplenishingMunition.cc	(revision 5815)
+++ code/branches/pickup/src/modules/weapons/munitions/ReplenishingMunition.cc	(revision 5935)
@@ -44,5 +44,5 @@
         // replenishIntervall_ and replenishMunitionAmount_ will be set in the constructor of the
         // inheriting class, which comes after this constructor)
-        this->replenishingTimer_.setTimer(0.0f, false, this, createExecutor(createFunctor(&ReplenishingMunition::initializeTimer)));
+        this->replenishingTimer_.setTimer(0.0f, false, createExecutor(createFunctor(&ReplenishingMunition::initializeTimer, this)));
     }
 
@@ -50,5 +50,5 @@
     {
         // Initialize the timer
-        this->replenishingTimer_.setTimer(this->replenishIntervall_, true, this, createExecutor(createFunctor(&ReplenishingMunition::replenish)));
+        this->replenishingTimer_.setTimer(this->replenishIntervall_, true, createExecutor(createFunctor(&ReplenishingMunition::replenish, this)));
     }
 
Index: code/branches/pickup/src/modules/weapons/munitions/ReplenishingMunition.h
===================================================================
--- code/branches/pickup/src/modules/weapons/munitions/ReplenishingMunition.h	(revision 5815)
+++ code/branches/pickup/src/modules/weapons/munitions/ReplenishingMunition.h	(revision 5935)
@@ -51,5 +51,5 @@
             void initializeTimer();
 
-            Timer<ReplenishingMunition> replenishingTimer_;
+            Timer replenishingTimer_;
     };
 }
Index: code/branches/pickup/src/modules/weapons/projectiles/LightningGunProjectile.cc
===================================================================
--- code/branches/pickup/src/modules/weapons/projectiles/LightningGunProjectile.cc	(revision 5815)
+++ code/branches/pickup/src/modules/weapons/projectiles/LightningGunProjectile.cc	(revision 5935)
@@ -42,5 +42,5 @@
         this->textureIndex_ = 1;
         this->maxTextureIndex_ = 8;
-        this->textureTimer_.setTimer(0.01f, true, this, createExecutor(createFunctor(&LightningGunProjectile::changeTexture)));
+        this->textureTimer_.setTimer(0.01f, true, createExecutor(createFunctor(&LightningGunProjectile::changeTexture, this)));
         
         registerVariables();
Index: code/branches/pickup/src/modules/weapons/projectiles/LightningGunProjectile.h
===================================================================
--- code/branches/pickup/src/modules/weapons/projectiles/LightningGunProjectile.h	(revision 5815)
+++ code/branches/pickup/src/modules/weapons/projectiles/LightningGunProjectile.h	(revision 5935)
@@ -50,5 +50,5 @@
             unsigned int textureIndex_;
             unsigned int maxTextureIndex_;
-            Timer<LightningGunProjectile> textureTimer_;
+            Timer textureTimer_;
             std::string materialBase_;
       private:
Index: code/branches/pickup/src/modules/weapons/projectiles/ParticleProjectile.cc
===================================================================
--- code/branches/pickup/src/modules/weapons/projectiles/ParticleProjectile.cc	(revision 5815)
+++ code/branches/pickup/src/modules/weapons/projectiles/ParticleProjectile.cc	(revision 5935)
@@ -59,5 +59,5 @@
         {
             this->detachOgreObject(this->particles_->getParticleSystem());
-            delete this->particles_;
+            this->particles_->destroy();
         }
     }
Index: code/branches/pickup/src/modules/weapons/projectiles/Projectile.cc
===================================================================
--- code/branches/pickup/src/modules/weapons/projectiles/Projectile.cc	(revision 5815)
+++ code/branches/pickup/src/modules/weapons/projectiles/Projectile.cc	(revision 5935)
@@ -61,5 +61,5 @@
             this->attachCollisionShape(shape);
 
-            this->destroyTimer_.setTimer(this->lifetime_, false, this, createExecutor(createFunctor(&Projectile::destroyObject)));
+            this->destroyTimer_.setTimer(this->lifetime_, false, createExecutor(createFunctor(&Projectile::destroyObject, this)));
         }
     }
@@ -84,5 +84,5 @@
 
         if (this->bDestroy_)
-            delete this;
+            this->destroy(); // TODO: use a scheduler instead of deleting the object right here in tick()
     }
 
@@ -90,5 +90,5 @@
     {
         if (GameMode::isMaster())
-            delete this;
+            this->destroy();
     }
 
@@ -133,8 +133,7 @@
     }
 
-    void Projectile::destroyedPawn(Pawn* pawn)
+    void Projectile::setOwner(Pawn* owner)
     {
-        if (this->owner_ == pawn)
-            this->owner_ = 0;
+        this->owner_ = owner;
     }
 }
Index: code/branches/pickup/src/modules/weapons/projectiles/Projectile.h
===================================================================
--- code/branches/pickup/src/modules/weapons/projectiles/Projectile.h	(revision 5815)
+++ code/branches/pickup/src/modules/weapons/projectiles/Projectile.h	(revision 5935)
@@ -33,10 +33,9 @@
 
 #include "tools/Timer.h"
-#include "interfaces/PawnListener.h"
 #include "worldentities/MovableEntity.h"
 
 namespace orxonox
 {
-    class _WeaponsExport Projectile : public MovableEntity, public PawnListener
+    class _WeaponsExport Projectile : public MovableEntity
     {
         public:
@@ -49,5 +48,4 @@
             virtual void tick(float dt);
             virtual bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
-            virtual void destroyedPawn(Pawn* pawn);
 
             inline void setDamage(float damage)
@@ -56,15 +54,14 @@
                 { return this->damage_; }
 
-            inline void setOwner(Pawn* owner)
-                { this->owner_ = owner; }
+            void setOwner(Pawn* owner);
             inline Pawn* getOwner() const
                 { return this->owner_; }
 
         private:
-            Pawn* owner_;
+            WeakPtr<Pawn> owner_;
             float lifetime_;
             float damage_;
             bool bDestroy_;
-            Timer<Projectile> destroyTimer_;
+            Timer destroyTimer_;
     };
 }
Index: code/branches/pickup/src/modules/weapons/weaponmodes/EnergyDrink.cc
===================================================================
--- code/branches/pickup/src/modules/weapons/weaponmodes/EnergyDrink.cc	(revision 5815)
+++ code/branches/pickup/src/modules/weapons/weaponmodes/EnergyDrink.cc	(revision 5935)
@@ -54,5 +54,5 @@
         this->setMunitionName("FusionMunition");
 
-        this->delayTimer_.setTimer(1.0f, false, this, createExecutor(createFunctor(&EnergyDrink::shot)));
+        this->delayTimer_.setTimer(1.0f, false, createExecutor(createFunctor(&EnergyDrink::shot, this)));
         this->delayTimer_.stopTimer();
     }
Index: code/branches/pickup/src/modules/weapons/weaponmodes/EnergyDrink.h
===================================================================
--- code/branches/pickup/src/modules/weapons/weaponmodes/EnergyDrink.h	(revision 5815)
+++ code/branches/pickup/src/modules/weapons/weaponmodes/EnergyDrink.h	(revision 5935)
@@ -59,5 +59,5 @@
             float speed_;
             float delay_;
-            Timer<EnergyDrink> delayTimer_;
+            Timer delayTimer_;
     };
 }
Index: code/branches/pickup/src/modules/weapons/weaponmodes/HsW01.cc
===================================================================
--- code/branches/pickup/src/modules/weapons/weaponmodes/HsW01.cc	(revision 5815)
+++ code/branches/pickup/src/modules/weapons/weaponmodes/HsW01.cc	(revision 5935)
@@ -54,5 +54,5 @@
         this->setMunitionName("LaserMunition");
 
-        this->delayTimer_.setTimer(1.0f, false, this, createExecutor(createFunctor(&HsW01::shot)));
+        this->delayTimer_.setTimer(1.0f, false, createExecutor(createFunctor(&HsW01::shot, this)));
         this->delayTimer_.stopTimer();
     }
Index: code/branches/pickup/src/modules/weapons/weaponmodes/HsW01.h
===================================================================
--- code/branches/pickup/src/modules/weapons/weaponmodes/HsW01.h	(revision 5815)
+++ code/branches/pickup/src/modules/weapons/weaponmodes/HsW01.h	(revision 5935)
@@ -57,5 +57,5 @@
             float speed_;
             float delay_;
-            Timer<HsW01> delayTimer_;
+            Timer delayTimer_;
     };
 }
