Index: code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.cc
===================================================================
--- code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.cc	(revision 7284)
+++ code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.cc	(revision 7301)
@@ -62,4 +62,5 @@
     DistanceMultiTrigger::~DistanceMultiTrigger()
     {
+
     }
 
@@ -81,4 +82,6 @@
 
         In this implementation we iterate through all possible objects and check whether the fact that they are in range or not has changed and fire and hand a state ofer to the MultiTrigger if so.
+    @return
+        Returns a pointer to a queue of MultiTriggerState pointers, containing all the necessary information to decide whether these states should indeed become new states of the MultiTrigger.
     */
     std::queue<MultiTriggerState*>* DistanceMultiTrigger::letTrigger(void)
@@ -92,7 +95,8 @@
             WorldEntity* entity = it->second->get();
             WorldEntity* key = it->first;
+            it++; // Incrementing the iterator in advance, since we don't need the current anymore and we potentially are going to delete the current element thus invalidating the iterator.
+            // If the entity no longer exists.
             if(entity == NULL)
             {
-                ++it;
                 this->removeFromRange(key);
                 continue;
@@ -103,9 +107,7 @@
             if (distanceVec.length() > this->distance_)
             {
+                // If for some reason the entity could not be removed.
                 if(!this->removeFromRange(key))
-                {
-                    ++it;
                     continue;
-                }
 
                 // If no queue has been created, yet.
@@ -115,28 +117,25 @@
                 // Create a state and append it to the queue.
                 MultiTriggerState* state = new MultiTriggerState;
-                state->bTriggered = false;
+                state->bTriggered = false; // Because the entity went out of range.
                 state->originator = entity;
                 queue->push(state);
             }
-            else
-                ++it;
         }
 
-        ClassTreeMask& targetMask = this->getTargetMask();
-
         // Check for new objects that are in range
-        for(ClassTreeMaskObjectIterator it = targetMask.begin(); it != targetMask.end(); ++it)
+        for(ClassTreeMaskObjectIterator it = this->getTargetMask().begin(); it != this->getTargetMask().end(); ++it)
         {
             WorldEntity* entity = static_cast<WorldEntity*>(*it);
-            if (entity == NULL) //If the object is no WorldEntity or is already in range.
-                continue;
-
-            // If the DistanceMultiTrigger is in single-target-mode.
+
+            // If the DistanceMultiTrigger is in single-target mode.
             if(this->singleTargetMode_)
             {
                 // If the object that is a target is no DistanceTriggerBeacon, then the DistanceMultiTrigger can't be in single-target-mode.
-                if(!(*it)->isA(ClassIdentifier<DistanceTriggerBeacon>::getIdentifier()))
+                if(!entity->isA(ClassIdentifier<DistanceTriggerBeacon>::getIdentifier()))
+                {
                     this->singleTargetMode_ = false;
-                // If the target name and the name of the DistancTriggreBeacon don't match.
+                    COUT(2) << "DistanceMultiTrigger " << this->getName() << " (&" << this <<  ")" << "is in single-target mode but the target is '" << entity->getIdentifier()->getName() << "' instead of DistanceTriggerBeacon. Setting single-target mode to false." << std::endl;
+                }
+                // If the target name and the name of the DistancTriggerBeacon don't match.
                 else if(entity->getName().compare(this->targetName_) != 0)
                     continue;
@@ -148,4 +147,5 @@
             {
                 // Add the object to the objects that are in range.
+                // Objects that already are in range are not added twice, because in a map (this->range_) each key can only exist once and thus addToRange() will reject all attempts of duplicate entries.
                 if(!this->addToRange(entity))
                     continue;
@@ -161,5 +161,5 @@
                 // Create a state and append it to the queue.
                 MultiTriggerState* state = new MultiTriggerState;
-                state->bTriggered = true;
+                state->bTriggered = true; // Because the entity came into range.
                 state->originator = entity;
                 queue->push(state);
@@ -170,3 +170,59 @@
     }
 
+    /**
+    @brief
+        Set the target name of DistanceTriggerBeacons that triggers this DistanceMultiTrigger.
+    @param targetname
+        The name of the DistanceTriggerBeacon as a string.
+    */
+    void DistanceMultiTrigger::setTargetName(const std::string& targetname)
+    {
+        // If the targetname is no blank string single-target mode is enabled.
+        if(targetname.compare(BLANKSTRING) != 0)
+            this->singleTargetMode_ = true;
+        else
+            this->singleTargetMode_ = false;
+
+        this->targetName_ = targetname;
+    }
+
+    /**
+    @brief
+        Add a given entity to the entities, that currently are in range of the DistanceMultiTrigger.
+    @param entity
+        A pointer to the entity.
+    @return
+        Returns true if successful, false if not.
+    */
+    bool DistanceMultiTrigger::addToRange(WorldEntity* entity)
+    {
+        WeakPtr<WorldEntity>* weakptr = new WeakPtr<WorldEntity>(entity);
+        std::pair<std::map<WorldEntity*, WeakPtr<WorldEntity>* >::iterator, bool> pair = this->range_.insert(std::pair<WorldEntity*, WeakPtr<WorldEntity>* >(entity, weakptr));
+
+        if(!pair.second)
+        {
+            delete weakptr;
+            return false;
+        }
+
+        return true;
+    }
+
+    /**
+    @brief
+        Remove a given entity from the set of entities, that currently are in range of the DistanceMultiTrigger.
+    @param entity
+        A pointer ot the entity.
+    @return
+        Returns true if successful.
+    */
+    bool DistanceMultiTrigger::removeFromRange(WorldEntity* entity)
+    {
+        WeakPtr<WorldEntity>* weakptr = this->range_.find(entity)->second;
+        bool erased = this->range_.erase(entity) > 0;
+        if(erased)
+            delete weakptr;
+        return erased;
+    }
+
 }
Index: code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.h
===================================================================
--- code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.h	(revision 7284)
+++ code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.h	(revision 7301)
@@ -48,5 +48,19 @@
     /**
     @brief
-        The DistanceMultiTrigger is a trigger that triggers whenever an object (that is of the specified target type) is in a specified range of the DistanceMultiTrigger. The object can be specified further by adding a DistanceTriggerBeacon (just attaching it) to the objects that can trigger this DistanceMultiTrigger and specify the name of the DistanceTriggerBeacon with the parameter targetname and only objects that hav a DistanceTriggerBeacon with that name attached will trigger the DistanceMultiTrigger.
+        The DistanceMultiTrigger is a trigger that triggers whenever an object (that is of the specified target type) is in a specified range of the DistanceMultiTrigger. The object can be specified further by adding a DistanceTriggerBeacon (just attaching it) to the objects that can trigger this DistanceMultiTrigger and specify the name of the DistanceTriggerBeacon with the parameter targetname and only objects that have a DistanceTriggerBeacon with that name attached will trigger the DistanceMultiTrigger.
+        Parameters are (additional to the ones of MultiTrigger):
+            'distance', which specifies the maximum distance at which the DistanceMultiTrigger still triggers. Default is 100.
+            'targetname', which, if not left blank, causes the DistancMultiTrigger to be in single-target mode, meaning, that it only reacts to objects that have a DistanceTriggerBeacon (therefore the target has to be set to DistanceTriggerBeacon for it to work), with the name specified by targetname, attached.
+
+        A simple DistanceMultiTrigger would look like this:
+        @code
+        <DistanceMultiTrigger position="0,0,0" switch="true" target="Pawn" distance="20" />
+        @endcode
+
+        An implementation that only reacts to objects with a DistanceTriggerBeacon attached would look like this:
+        @code
+        <DistanceMultiTrigger position="0,0,0" target="DistanceMultiTrigger" targetname="beacon1" distance="30" />
+        @endcode
+        This particular DistanceMultiTrigger would only react if an object was in range, that had a DistanceTriggerBeacon with the name 'beacon1' attached.
     @see MultiTrigger.h
         For more information on MultiTriggers.
@@ -59,14 +73,9 @@
         public:
             DistanceMultiTrigger(BaseObject* creator); //!< Default Constructor. Registers the object and initializes default values.
-            ~DistanceMultiTrigger(); //!< Destructor.
+            virtual ~DistanceMultiTrigger(); //!< Destructor.
 
             void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a DistanceMultiTrigger object through XML.
 
-            /**
-            @brief Set the target name of DistanceTriggerBeacons that triggers this DistanceMultiTrigger.
-            @param targename The name of the DistanceTriggerBeacon as a string.
-            */
-            inline void setTargetName(const std::string& targetname)
-                { if(targetname.compare(BLANKSTRING) != 0) this->singleTargetMode_ = true; else this->singleTargetMode_ = false; this->targetName_ = targetname; }
+            void setTargetName(const std::string& targetname); //!< Set the target name of DistanceTriggerBeacons that triggers this DistanceMultiTrigger.
             /**
             @brief Get the target name of the DistanceTriggerbeacon, that triggers this DistanceMultiTrigger.
@@ -92,18 +101,6 @@
             virtual std::queue<MultiTriggerState*>* letTrigger(void); //!< This method is called by the MultiTrigger to get information about new trigger events that need to be looked at.
 
-            /**
-            @brief Add a given entity to the entities, that currently are in range of the DistanceMultiTrigger.
-            @param entity A pointer to the entity.
-            @return Returns true if successful, false if not.
-            */
-            inline bool addToRange(WorldEntity* entity)
-                { std::pair<std::map<WorldEntity*, WeakPtr<WorldEntity>* >::iterator, bool> pair = this->range_.insert(std::pair<WorldEntity*, WeakPtr<WorldEntity>* >(entity, new WeakPtr<WorldEntity>(entity))); return pair.second; }
-            /**
-            @brief Remove a given entity from the set of entities, that currently are in range of the DistanceMultiTrigger.
-            @param entity A pointer ot the entity.
-            @return Returns true if successful.
-            */
-            inline bool removeFromRange(WorldEntity* entity)
-                { WeakPtr<WorldEntity>* weakptr = this->range_.find(entity)->second; bool erased = this->range_.erase(entity) > 0; if(erased) delete weakptr; return erased; }
+            bool addToRange(WorldEntity* entity); //!< Add a given entity to the entities, that currently are in range of the DistanceMultiTrigger.
+            bool removeFromRange(WorldEntity* entity); //!< Remove a given entity from the set of entities, that currently are in range of the DistanceMultiTrigger.
 
         private:
Index: code/trunk/src/modules/objects/triggers/DistanceTrigger.cc
===================================================================
--- code/trunk/src/modules/objects/triggers/DistanceTrigger.cc	(revision 7284)
+++ code/trunk/src/modules/objects/triggers/DistanceTrigger.cc	(revision 7301)
@@ -129,8 +129,14 @@
         continue;
 
+      // If the DistanceTrigger is in single-target mode.
       if(this->singleTargetMode_)
       {
+        // If the object that is a target is no DistanceTriggerBeacon, then the DistanceTrigger can't be in single-target-mode.
         if(!(*it)->isA(ClassIdentifier<DistanceTriggerBeacon>::getIdentifier()))
+        {
           this->singleTargetMode_ = false;
+          COUT(2) << "DistanceTrigger " << this->getName() << " (&" << this <<  ")" << "is in single-target mode but the target is '" << entity->getIdentifier()->getName() << "' instead of DistanceTriggerBeacon. Setting single-target mode to false." << std::endl;
+        }
+        // If the target name and the name of the DistancTriggerBeacon don't match.
         else if(entity->getName().compare(this->targetName_) != 0)
           continue;
@@ -145,4 +151,5 @@
         {
 
+          // Change the entity to the parent of the DistanceTriggerBeacon (if in single-target-mode), which is the entity to which the beacon is attached.
           if(this->singleTargetMode_)
             entity = entity->getParent();
Index: code/trunk/src/modules/objects/triggers/DistanceTrigger.h
===================================================================
--- code/trunk/src/modules/objects/triggers/DistanceTrigger.h	(revision 7284)
+++ code/trunk/src/modules/objects/triggers/DistanceTrigger.h	(revision 7301)
@@ -23,5 +23,5 @@
  *      Benjamin Knecht
  *   Co-authors:
- *      ...
+ *      Damian 'Mozork' Frick
  *
  */
Index: code/trunk/src/modules/objects/triggers/DistanceTriggerBeacon.cc
===================================================================
--- code/trunk/src/modules/objects/triggers/DistanceTriggerBeacon.cc	(revision 7284)
+++ code/trunk/src/modules/objects/triggers/DistanceTriggerBeacon.cc	(revision 7301)
@@ -27,4 +27,9 @@
 */
 
+/**
+    @file DistanceTriggerBeacon.cc
+    @brief Implementation of the DistanceTriggerBeacon class.
+*/
+
 #include "DistanceTriggerBeacon.h"
 
@@ -36,4 +41,10 @@
     CreateFactory(DistanceTriggerBeacon);
 
+    /**
+    @brief
+        Constructor. Registers the object.
+    @param creator
+        The creator of this object.
+    */
     DistanceTriggerBeacon::DistanceTriggerBeacon(BaseObject* creator) : StaticEntity(creator)
     {
Index: code/trunk/src/modules/objects/triggers/DistanceTriggerBeacon.h
===================================================================
--- code/trunk/src/modules/objects/triggers/DistanceTriggerBeacon.h	(revision 7284)
+++ code/trunk/src/modules/objects/triggers/DistanceTriggerBeacon.h	(revision 7301)
@@ -27,4 +27,9 @@
 */
 
+/**
+    @file DistanceTriggerBeacon.h
+    @brief Definition of the DistanceTriggerBeacon class.
+*/
+
 #ifndef _DistanceTriggerBeacon_H__
 #define _DistanceTriggerBeacon_H__
@@ -37,11 +42,17 @@
 {
 
+    /**
+    @brief
+        A DistanceTriggerBeacon can be used together with a DistanceTrigger or a DistanceMultiTrigger to make them only react to specific objects.
+        This can be done by attaching a DistanceTriggerBeacon to an object, giving it a unique name and setting the targetname in the DistanceTrigger (or DistanceMultiTrigger) to that name and the target to DistanceTriggerBeacon.
+    @author
+        Damian 'Mozork' Frick
+    */
     class _ObjectsExport DistanceTriggerBeacon : public StaticEntity
     {
 
         public:
-
-            DistanceTriggerBeacon(BaseObject* creator);
-            ~DistanceTriggerBeacon() {}
+            DistanceTriggerBeacon(BaseObject* creator); //!< Constructor.
+            virtual ~DistanceTriggerBeacon() {} //!< Destructor.
 
     };
Index: code/trunk/src/modules/objects/triggers/EventMultiTrigger.cc
===================================================================
--- code/trunk/src/modules/objects/triggers/EventMultiTrigger.cc	(revision 7284)
+++ code/trunk/src/modules/objects/triggers/EventMultiTrigger.cc	(revision 7301)
@@ -37,4 +37,5 @@
 #include "core/EventIncludes.h"
 #include "core/XMLPort.h"
+#include "MultiTriggerContainer.h"
 
 namespace orxonox
@@ -43,11 +44,17 @@
     CreateFactory(EventMultiTrigger);
 
+    /**
+    @brief
+        Constructor. Registers the object.
+    */
     EventMultiTrigger::EventMultiTrigger(BaseObject* creator) : MultiTrigger(creator)
     {
         RegisterObject(EventMultiTrigger);
-
-        this->bEventTriggered_ = false;
     }
 
+    /**
+    @brief
+        Destructor.
+    */
     EventMultiTrigger::~EventMultiTrigger()
     {
@@ -55,4 +62,8 @@
     }
 
+    /**
+    @brief
+        Method for creating an EventMultiTrigger object through XML.
+    */
     void EventMultiTrigger::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     {
@@ -62,4 +73,8 @@
     }
 
+    /**
+    @brief
+        Creates an event port.
+    */
     void EventMultiTrigger::XMLEventPort(Element& xmlelement, XMLPort::Mode mode)
     {
@@ -69,4 +84,34 @@
     }
 
+    /**
+    @brief
+        Method that causes the EventMultiTrigger to trigger upon receiving an event.
+    @param bTriggered
+        Whether the event is a triggering or an un-triggering event.
+    @param originator
+        A pointer to the entity the event originates from.
+    */
+    void EventMultiTrigger::trigger(bool bTriggered, BaseObject* originator)
+    {
+        // If the originator is a MultiTriggerContainer, the event originates from a MultiTrigger and thus the event only triggers the EventMultiTrigger for the originator that caused the MultiTrigger to trigger.
+        if(originator != NULL && originator->isA(ClassIdentifier<MultiTriggerContainer>::getIdentifier()))
+        {
+            MultiTriggerContainer* container = static_cast<MultiTriggerContainer*>(originator);
+            // If the entity that triggered the MultiTrigger is no target of this EventMultiTrigger we process it as it weren't an event caused by a MultiTrigger.
+            // But if it is the EventMultiTrigger only triggers for the entity tha caused the MultiTrigger to trigger.
+            if(this->isTarget(container->getData()))
+            {
+                if(this->isTriggered(container->getData()) ^ bTriggered)
+                    this->changeTriggered(container->getData());
+
+                return;
+            }
+        }
+
+        // If we don't know who exactly caused the event we just send a broadcast.
+        if(this->isTriggered() ^ bTriggered)
+            this->changeTriggered();
+    }
+
 }
 
Index: code/trunk/src/modules/objects/triggers/EventMultiTrigger.h
===================================================================
--- code/trunk/src/modules/objects/triggers/EventMultiTrigger.h	(revision 7284)
+++ code/trunk/src/modules/objects/triggers/EventMultiTrigger.h	(revision 7301)
@@ -42,19 +42,39 @@
 {
 
+    /**
+    @brief
+        The EventMultiTrigger class is the equivalent of the EventTrigger class for MultiTriggers.
+        Consequentially what it does is it provides a way to have a MultiTrigger triggered by any kinds of events.
+        Events that are not caused by a MultiTrigger or by a MultiTrigger with an originator that is no target of this EventMultiTrigger are broadcasted to all entities that are the target of this EventMultitrigger. Events that are caused by MultiTriggers with an originator that is a target of this EventMultiTrigger just trigger the EventMultiTrigger for the originator that caused the MultiTrigger to trigger. Thus showing the equivalent behavior to the EventTrigger.
+
+        Example:
+        @code
+        <EventMultiTrigger invert="true">
+            <events>
+                <trigger>
+                    <MultiTrigger ... />
+                    <EventListener ... />
+                </trigger>
+            </events>
+        </EventMultiTrigger>
+        @endcode
+    @see MultiTrigger.h
+        For more information on MultiTriggers.
+    @author
+        Damian 'Mozork' Frick
+    */
     class _ObjectsExport EventMultiTrigger : public MultiTrigger
     {
 
         public:
-            EventMultiTrigger(BaseObject* creator);
-            ~EventMultiTrigger();
+            EventMultiTrigger(BaseObject* creator); //!< Constructor. Registers the object.
+            virtual ~EventMultiTrigger(); //!< Destructor.
 
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating an EventMultiTrigger object through XML.
             virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
 
-            inline void trigger(bool bTriggered)
-                { this->bEventTriggered_ = bTriggered; this->changeTriggered(); }
+        private:
+            void trigger(bool bTriggered, BaseObject* originator); //!< Method that causes the EventMultiTrigger to trigger upon receiving an event.
 
-        private:
-            bool bEventTriggered_;
     };
 
Index: code/trunk/src/modules/objects/triggers/MultiTrigger.cc
===================================================================
--- code/trunk/src/modules/objects/triggers/MultiTrigger.cc	(revision 7284)
+++ code/trunk/src/modules/objects/triggers/MultiTrigger.cc	(revision 7301)
@@ -23,5 +23,5 @@
  *      Damian 'Mozork' Frick
  *   Co-authors:
- *      Benjamin Knecht
+ *      ...
  *
 */
@@ -67,5 +67,5 @@
 
         this->remainingActivations_ = INF_s;
-        this->maxNumSimultaniousTriggerers_ = INF_s;
+        this->maxNumSimultaneousTriggerers_ = INF_s;
 
         this->bInvertMode_ = false;
@@ -109,5 +109,5 @@
         XMLPortParam(MultiTrigger, "stayactive", setStayActive, getStayActive, xmlelement, mode);
         XMLPortParam(MultiTrigger, "activations", setActivations, getActivations, xmlelement, mode);
-        XMLPortParam(MultiTrigger, "simultaniousTriggerers", setSimultaniousTriggerers, getSimultaniousTriggerers, xmlelement, mode);
+        XMLPortParam(MultiTrigger, "simultaneousTriggerers", setSimultaneousTriggerers, getSimultaneousTriggerers, xmlelement, mode);
         XMLPortParam(MultiTrigger, "invert", setInvert, getInvert, xmlelement, mode);
         XMLPortParamTemplate(MultiTrigger, "mode", setMode, getModeString, xmlelement, mode, const std::string&);
@@ -115,5 +115,4 @@
         XMLPortParamLoadOnly(MultiTrigger, "target", addTargets, xmlelement, mode).defaultValues("Pawn"); //TODO: Remove load only
 
-        //TODO: Maybe nicer with explicit subgroup, e.g. triggers
         XMLPortObject(MultiTrigger, MultiTrigger, "", addTrigger, getTrigger, xmlelement, mode);
 
@@ -131,9 +130,9 @@
     {
         // If this is the first tick.
-        //TODO: Determine need for this, else kick it out.
         if(this->bFirstTick_)
         {
             this->bFirstTick_ = false;
-            this->fire(false);
+            // Fire for all objects that are targets.
+            this->broadcast(false);
         }
 
@@ -154,5 +153,5 @@
                 if(state == NULL)
                 {
-                    COUT(1) << "In MultiTrigger '" << this->getName() << "' (&" << this << "), Error: State of new states queue was NULL." << std::endl;
+                    COUT(1) << "In MultiTrigger '" << this->getName() << "' (&" << this << "), Error: State of new states queue was NULL. State ignored." << std::endl;
                     queue->pop();
                     continue;
@@ -162,16 +161,13 @@
                 bool bTriggered = (state->bTriggered & this->isModeTriggered(state->originator)) ^ this->bInvertMode_;
 
-                // If the 'triggered' state has changed a new state is added to the state queue.
-                //TODO: Do something against flooding, when there is delay.
-                if(this->delay_ != 0.0f || bTriggered ^ this->isTriggered(state->originator))
+                // If the 'triggered' state has changed or the MultiTrigger has delay and thus we don't know whether this state will actually change the 'triggered' state, a new state is added to the state queue.
+                if(this->delay_ > 0.0f || bTriggered ^ this->isTriggered(state->originator))
                 {
                     state->bTriggered = bTriggered;
                     this->addState(state);
                 }
+                // Else the change is irrelevant.
                 else
-                {
-                    COUT(1) << "BUH" << std::endl;
                     delete state;
-                }
 
                 queue->pop();
@@ -181,5 +177,5 @@
 
         // Go through the state queue and activate all pending states whose remaining time has expired.
-        if (this->stateQueue_.size() > 0)
+        if(this->stateQueue_.size() > 0)
         {
             MultiTriggerState* state;
@@ -195,21 +191,17 @@
                 if(timeRemaining <= dt)
                 {
-                    // If the maximum number of objects simultaniously triggering this MultiTrigger is not exceeded.
-                    if(this->maxNumSimultaniousTriggerers_ == INF_s || this->triggered_.size() < (unsigned int)this->maxNumSimultaniousTriggerers_)
+                    // If the maximum number of objects simultaneously triggering this MultiTrigger is not exceeded.
+                    if(this->maxNumSimultaneousTriggerers_ == INF_s || this->triggered_.size() < (unsigned int)this->maxNumSimultaneousTriggerers_)
                     {
                         bool bStateChanged = false;
-                        // If the 'triggered' state is different form what it is now, change it.
+                        // If the 'triggered' state is different from what it is now, change it.
                         if(state->bTriggered ^ this->isTriggered(state->originator))
                         {
                             // Add the originator to the objects triggering this MultiTrigger.
                             if(state->bTriggered == true)
-                            {
                                 this->triggered_.insert(state->originator);
-                            }
                             // Remove the originator from the objects triggering this MultiTrigger.
                             else
-                            {
                                 this->triggered_.erase(state->originator);
-                            }
 
                             bStateChanged = true;
@@ -218,5 +210,5 @@
                         // Get the activity of the new state.
                         bool bActive;
-                        // If the MultiTrigger is in switch mode.
+                        // If the MultiTrigger is in switch mode the 'active'-state only changes of the state changed to triggered.
                         if(this->bSwitch_ && !state->bTriggered)
                             bActive = this->isActive(state->originator);
@@ -233,5 +225,6 @@
                             if(bActive == true)
                             {
-                                if(this->remainingActivations_ != 0)
+                                // If the MultiTrigger has not exceeded its remaining activations.
+                                if(this->remainingActivations_ > 0)
                                 {
                                     this->active_.insert(state->originator);
@@ -240,19 +233,14 @@
                                 }
                                 else
-                                {
                                     bFire = false;
-                                }
                             }
                             // Remove the originator from the objects activating this MultiTrigger.
                             else
                             {
-                                if(!this->bStayActive_ || this->remainingActivations_ != 0)
-                                {
+                                // If the MultiTrigger doesn't stay active or hasn't' exceeded its remaining activations.
+                                if(!this->bStayActive_ || this->remainingActivations_ > 0)
                                     this->active_.erase(state->originator);
-                                }
                                 else
-                                {
                                     bFire = false;
-                                }
                             }
 
@@ -260,8 +248,8 @@
                             if(bFire)
                             {
+                                // If the MultiTrigger is set to broadcast and has no originator a boradcast is fired.
                                 if(this->bBroadcast_ && state->originator == NULL)
-                                {
                                     this->broadcast(bActive);
-                                }
+                                // Else a normal event is fired.
                                 else
                                     this->fire(bActive, state->originator);
@@ -271,16 +259,18 @@
                         }
 
-                        // Print some debug output if the state has changed.
                         if(bStateChanged)
                         {
+                            // Print some debug output if the state has changed.
                             if(state->originator != NULL)
                                 COUT(4) << "MultiTrigger '" << this->getName() << "' (&" << this << ") changed state. originator: " << state->originator->getIdentifier()->getName() << " (&" << state->originator << "), active: " << bActive << ", triggered: " << state->bTriggered << "." << std::endl;
                             else
                                 COUT(4) << "MultiTrigger '" << this->getName() << "' (&" << this << ") changed state. originator: NULL, active: " << bActive << ", triggered: " << state->bTriggered << "." << std::endl;
+
+                            // If the MultiTrigger has a parent trigger it needs to call a method to notify him, that its activity has changed.
                             if(this->parentTrigger_ != NULL)
-                                this->parentTrigger_->subTrigggerActivityChanged(state->originator);
+                                this->parentTrigger_->subTriggerActivityChanged(state->originator);
                         }
 
-                        // If the MultiTrigger has exceeded its amount of activations and it doesn't stay active, it has to be destroyed,
+                        // If the MultiTrigger has exceeded its amount of activations and it doesn't stay active, it has to be deactivated.
                         if(this->remainingActivations_ == 0 && !bActive)
                         {
@@ -293,7 +283,6 @@
                     this->stateQueue_.pop_front();
                     delete state;
-                    size -= 1;
                 }
-                // If the remaining time has not yet expired. Decrement the remainig time.
+                // If the remaining time has not yet expired. Decrement the remainig time and put the state at the end of the queue.
                 else
                 {
@@ -308,5 +297,5 @@
     @brief
         Get whether the MultiTrigger is active for a given object.
-    @param triggerers
+    @param triggerer
         A pointer to the object.
     @return
@@ -335,4 +324,6 @@
         else if (modeName == MultiTrigger::xor_s)
             this->setMode(MultiTriggerMode::EventTriggerXOR);
+        else
+            COUT(2) << "Invalid mode '" << modeName << "' in MultiTrigger " << this->getName() << " &(" << this << "). Leaving mode at '" << this->getModeString() << "'." << std::endl;
     }
 
@@ -351,5 +342,5 @@
         else if (this->mode_ == MultiTriggerMode::EventTriggerXOR)
             return MultiTrigger::xor_s;
-        else
+        else // This can never happen, but the compiler needs it to feel secure.
             return MultiTrigger::and_s;
     }
@@ -365,7 +356,8 @@
         Identifier* target = ClassByString(targetStr);
 
+        // If the target is not a valid class name display an error.
         if (target == NULL)
         {
-            COUT(1) << "Error: \"" << targetStr << "\" is not a valid class name to include in ClassTreeMask (in " << this->getName() << ", class " << this->getIdentifier()->getName() << ')' << std::endl;
+            COUT(1) << "Error: '" << targetStr << "' is not a valid class name to include in ClassTreeMask (in " << this->getName() << ", class " << this->getIdentifier()->getName() << ")" << std::endl;
             return;
         }
@@ -373,13 +365,12 @@
         this->targetMask_.include(target);
 
-        // A MultiTriggers shouldn't react to itself or other MultiTriggers.
+        // A MultiTrigger shouldn't react to itself or other MultiTriggers.
         this->targetMask_.exclude(Class(MultiTrigger), true);
 
         // We only want WorldEntities
+        //TODO: Really?
         ClassTreeMask WEMask;
         WEMask.include(Class(WorldEntity));
         this->targetMask_ *= WEMask;
-
-        this->notifyMaskUpdate();
     }
 
@@ -393,4 +384,12 @@
     {
         Identifier* target = ClassByString(targetStr);
+
+        // If the target is not a valid class name display an error.
+        if (target == NULL)
+        {
+            COUT(1) << "Error: '" << targetStr << "' is not a valid class name to include in ClassTreeMask (in " << this->getName() << ", class " << this->getIdentifier()->getName() << ")" << std::endl;
+            return;
+        }
+
         this->targetMask_.exclude(target);
     }
@@ -401,5 +400,5 @@
         Beware: Loops are not prevented and potentially very bad, so just don't create any loops.
     @param trigger
-        The trigger to be added.
+        The MultiTrigger to be added.
     */
     void MultiTrigger::addTrigger(MultiTrigger* trigger)
@@ -436,8 +435,8 @@
     @brief
         This method is called by the MultiTrigger to get information about new trigger events that need to be looked at.
-        This method is the device for the behaviour (the conditions under which the MultiTrigger triggers) of any derived class from MultiTrigger.
-    @return
-        A pointer to a queue of MultiTriggerState pointers is returned, containing all the neccessary information to decide whether these states should indeed become new states of the MultiTrigger.
-        Please be aware that both the queue and the states in the queue need to be deleted one they have been used. This is already done in the tick() method of this class but would have to be done by any method calling this method.
+        This method is the device for the behavior (the conditions under which the MultiTrigger triggers) of any derived class of MultiTrigger.
+    @return
+        Returns a pointer to a queue of MultiTriggerState pointers, containing all the necessary information to decide whether these states should indeed become new states of the MultiTrigger.
+        Please be aware that both the queue and the states in the queue need to be deleted once they have been used. This is already done in the tick() method of this class but would have to be done by any method calling this method.
     */
     std::queue<MultiTriggerState*>* MultiTrigger::letTrigger(void)
@@ -464,9 +463,9 @@
     /**
     @brief
-        This method is called by any sub-trigger to advertise changes in it's state to it's parent-trigger.
+        This method is called by any sub-trigger to advertise changes in its state to its parent-trigger.
     @param originator
         The object that caused the change in activity.
     */
-    void MultiTrigger::subTrigggerActivityChanged(BaseObject* originator)
+    void MultiTrigger::subTriggerActivityChanged(BaseObject* originator)
     {
         MultiTriggerState* state = new MultiTriggerState;
@@ -479,5 +478,5 @@
     @brief
         Checks whether the sub-triggers are in such a way that, according to the mode of the MultiTrigger, the MultiTrigger is triggered (only considering the sub-triggers, not the state of MultiTrigger itself), for a given object.
-        To make an example: When the mode is 'and', then this would be true or a given object if all the sub-triggers were triggered ofr the given object.
+        To make an example: When the mode is 'and', then this would be true or a given object if all the sub-triggers were triggered for the given object.
     @param triggerer
         The object.
@@ -487,9 +486,9 @@
     bool MultiTrigger::isModeTriggered(BaseObject* triggerer)
     {
-        if (this->subTriggers_.size() != 0)
+        if(this->subTriggers_.size() != 0)
         {
             bool returnVal = false;
 
-            switch (this->mode_)
+            switch(this->mode_)
             {
                 case MultiTriggerMode::EventTriggerAND:
@@ -502,5 +501,5 @@
                     returnVal = checkXor(triggerer);
                     break;
-                default:
+                default: // This will never happen.
                     returnVal = false;
                     break;
@@ -532,5 +531,5 @@
     @brief
         Helper method. Creates an Event for the given status and originator and fires it.
-        Or more precisely creates a MultiTriggerContainer to encompass all neccesary information and creates an Event from that and sends it.
+        Or more precisely creates a MultiTriggerContainer to encompass all neccesary information, creates an Event from that and sends it.
     @param status
         The status of the Event to be fired. This is equivalent to the activity of the MultiTrigger.
@@ -562,11 +561,6 @@
     void MultiTrigger::broadcast(bool status)
     {
-        ClassTreeMask& targetMask = this->getTargetMask();
-
-        for(ClassTreeMaskObjectIterator it = targetMask.begin(); it != targetMask.end(); ++it)
-        {
-            BaseObject* object = static_cast<BaseObject*>(*it);
-            this->fire(status, object);
-        }
+        for(ClassTreeMaskObjectIterator it = this->getTargetMask().begin(); it != this->getTargetMask().end(); ++it)
+            this->fire(status, static_cast<BaseObject*>(*it));
     }
 
@@ -576,14 +570,19 @@
     @param state
         The state to be added.
+    @return
+        Returns true if the state has been added, false if not. If the state has not been added this method destroys it.
     */
     bool MultiTrigger::addState(MultiTriggerState* state)
     {
-        assert(state);
+        assert(state); // The state really shouldn't be NULL.
 
         // If the originator is no target of this MultiTrigger.
         if(!this->isTarget(state->originator))
+        {
+            delete state;
             return false;
-
-        // Add it ot the state queue.
+        }
+
+        // Add it ot the state queue with the delay specified for the MultiTrigger.
         this->stateQueue_.push_back(std::pair<float, MultiTriggerState*>(this->delay_, state));
 
@@ -597,12 +596,11 @@
         The object.
     @return
-        Returns true if they do.
+        Returns true if all the sub-triggers are active.
     */
     bool MultiTrigger::checkAnd(BaseObject* triggerer)
     {
-        std::set<MultiTrigger*>::iterator it;
-        for(it = this->subTriggers_.begin(); it != this->subTriggers_.end(); ++it)
-        {
-            if (!(*it)->isActive(triggerer))
+        for(std::set<MultiTrigger*>::iterator it = this->subTriggers_.begin(); it != this->subTriggers_.end(); ++it)
+        {
+            if(!(*it)->isActive(triggerer))
                 return false;
         }
@@ -616,12 +614,11 @@
         The object.
     @return
-        Returns true if they do.
+        Returns true if at least one sub-trigger is active.
     */
     bool MultiTrigger::checkOr(BaseObject* triggerer)
     {
-        std::set<MultiTrigger*>::iterator it;
-        for(it = this->subTriggers_.begin(); it != this->subTriggers_.end(); ++it)
-        {
-            if ((*it)->isActive(triggerer))
+        for(std::set<MultiTrigger*>::iterator it = this->subTriggers_.begin(); it != this->subTriggers_.end(); ++it)
+        {
+            if((*it)->isActive(triggerer))
                 return true;
         }
@@ -635,15 +632,15 @@
         The object.
     @return
-        Returns true if they do.
+        Returns true if exactly one sub-trigger is active.
     */
     bool MultiTrigger::checkXor(BaseObject* triggerer)
     {
-        std::set<MultiTrigger*>::iterator it;
         bool test = false;
-        for(it = this->subTriggers_.begin(); it != this->subTriggers_.end(); ++it)
-        {
-            if (test && (*it)->isActive(triggerer))
+        for(std::set<MultiTrigger*>::iterator it = this->subTriggers_.begin(); it != this->subTriggers_.end(); ++it)
+        {
+            if(test && (*it)->isActive(triggerer))
                 return false;
-            if ((*it)->isActive(triggerer))
+
+            if((*it)->isActive(triggerer))
                 test = true;
         }
Index: code/trunk/src/modules/objects/triggers/MultiTrigger.h
===================================================================
--- code/trunk/src/modules/objects/triggers/MultiTrigger.h	(revision 7284)
+++ code/trunk/src/modules/objects/triggers/MultiTrigger.h	(revision 7301)
@@ -23,5 +23,5 @@
  *      Damian 'Mozork' Frick
  *   Co-authors:
- *      Benjamin Knecht
+ *      ...
  *
 */
@@ -70,22 +70,32 @@
     @brief
         The MultiTrigger class implements a trigger that has a distinct state for each object triggering it.
-        In more detail: A Trigger is an object that can either be active or inactive, whith a specified behaviour how to switch between the two. A MultiTrigger generalizes that behaviour for multiple objects trigggering the trigger. A MultiTrigger can be active or inactive for any object triggering it, with the state for each object being completely independent of the state for other objects. Each time a switch occurs an Event is fired with as the originator a MultiTriggerContainer, containig a pointer to the pointer that caused the Event and a pointer to the object that caused the trigger to change it's activity.
-
-        MultiTriggers also allow for additional complexity which can be added trough the choice of the parameters explained (briefly) below:
-        But first you must understand a small implementational detail. There is a distinction between the MultiTrigger being triggered (there is the state 'triggered' for that) and the MultiTrigger being active (for that is the state 'activity'). From the outside only the activity is visible. The state 'triggered' tells us whether the trigger is actually triggered, but it could pretend (for some reason, some of which we will see shortly) to be triggered (or to the outside, active), while it in fact isn't. The standard behaviour is, that the cativity changes, when the MultiTrigger transits from being triggered to not being triggered or the other way around.
+        In more detail: A Trigger is an object that can either be active or inactive, with a specified behavior how to switch between the two. A MultiTrigger generalizes that behavior for multiple objects triggering the trigger. A MultiTrigger can be active or inactive for any object triggering it, with the state for each object being completely independent of the state for other objects. Each time a switch occurs an Event is fired with as the originator a MultiTriggerContainer, containing a pointer to the MultiTrigger that caused the Event and a pointer to the object that caused the trigger to change it's activity.
+
+        MultiTriggers also allow for additional complexity which can be added through the choice of the parameters explained (briefly) below:
+        But first you must understand a small implementational detail. There is a distinction between the MultiTrigger being triggered (there is the state 'triggered' for that) and the MultiTrigger being active (for that is the state 'activity'). From the outside only the activity is visible. The state 'triggered' tells us whether the trigger is actually triggered, but it could pretend (for some reason, some of which we will see shortly) to be triggered (or to the outside, active), while it in fact isn't. The standard behavior is, that the activity changes, when the MultiTrigger transits from being triggered to not being triggered or the other way around.
         The parameters are:
             'delay':                    The delay is the time that the trigger waits until it reacts (i.e. changes it's state) to the triggering condition being fulfilled.
             'switch':                   Switch is a bool, if true the MultiTrigger is in switch-mode, meaning, that the activity changes only when the trigger is triggered , this means, that now the activity only changes, when the trigger changes from not being triggered to being triggered but not the other way around. The default is false.
-            'stayactive':               Stay active is also a bool, if true the MultiTrigger stays active after it has been activated as many times as specified by the parameter activations. The default is -1, which is infinity.
+            'stayactive':               Stay active is also a bool, if true the MultiTrigger stays active after it has been activated as many times as specified by the parameter activations. The default is false.
             'activations':              The number of activations until the trigger can't be triggered anymore. The default is -1, which is infinity.
-            'invert':                   Invert is a bool, if true the trigger is in invert-mode, meaning, that if the triggering condition is fulfilled the MultiTrigger will have the state not triggered and and if the condition is not fulfilled it will have the state triggered. In short it just inverts the behaviour of the MultiTrigger. The default is false.
-            'simultaniousTriggerers':   The number of simultanious triggerers limits the number of object that are allowed to trigger the MultiTrigger at the same time. Or a little more precisely, the number of distinct objects the MultiTrigger has 'triggered' states for, at each point in time.
-            'mode':                     The mode describes how the MultiTrigger acts in relation to all the MultiTriggers, that are appended to it. There are 3 modes: 'and', meaning that the MultiTrigger can only be triggered if all the appended MultiTriggers are active. 'or', meaning that the MultiTrigger can only triggered if at least one of the appendend MultiTriggers is active. And 'xor', meaning that the MultiTrigger can only be triggered if one and only one appended MultiTrigger is active. Notice, that I wrote 'can only be active', that implies, that there is an addtitional condition to the activity of the MultiTrigger and that is the fulfillment of the triggering condition (the MultiTrigger itself doesn't have one, but all derived classes should). Also bear in mind, that the activity of a MultiTrigger is still coupled to the object that triggered it. The default is 'and'.
-            'broadcast'                 Broadcast is a bool, if true the MutliTrigger is in broadcast-mode, meaining, that all trigger events that are caused by no originator (originator is NULL) are broadcast as having come from every possible originator, or more precisely as having come from all objects that are specified targets of this MultiTrigger.
+            'invert':                   Invert is a bool, if true the trigger is in invert-mode, meaning, that if the triggering condition is fulfilled the MultiTrigger will have the state not triggered and and if the condition is not fulfilled it will have the state triggered. In short it just inverts the behavior of the MultiTrigger. The default is false.
+            'simultaneousTriggerers':   The number of simultaneous triggerers limits the number of objects that are allowed to trigger the MultiTrigger at the same time. Or more precisely, the number of distinct objects the MultiTrigger has 'triggered' states for, at each point in time. The default is -1, which denotes infinity.
+            'mode':                     The mode describes how the MultiTrigger acts in relation to all the MultiTriggers, that are appended to it. There are 3 modes: 'and', meaning that the MultiTrigger can only be triggered if all the appended MultiTriggers are active. 'or', meaning that the MultiTrigger can only triggered if at least one of the appended MultiTriggers is active. And 'xor', meaning that the MultiTrigger can only be triggered if one and only one appended MultiTrigger is active. Note, that I wrote 'can only be active', that implies, that there is an additional condition to the activity of the MultiTrigger and that is the fulfillment of the triggering condition (the MultiTrigger itself doesn't have one, but all derived classes should). Also bear in mind, that the activity of a MultiTrigger is still coupled to the object that triggered it. The default is 'and'.
+            'broadcast'                 Broadcast is a bool, if true the MutliTrigger is in broadcast-mode, meaning, that all trigger events that are caused by no originator (originator is NULL) are broadcast as having come from every possible originator, or more precisely as having come from all objects that are specified targets of this MultiTrigger. The default is false.
             'target':                   The target describes the kind of objects that are allowed to trigger this MultiTrigger. The default is 'Pawn'.
-            Also there is the possibility of appending MultiTriggers to the MultiTrigger just by adding them as subobjects in the XML description of your MultiTrigger.
+            Also there is the possibility of appending MultiTriggers to the MultiTrigger just by adding them as sub-objects in the XML description of your MultiTrigger.
+
+        An example of a MultiTrigger created through XML would look like this:
+        @code
+        <MultiTrigger position="0,0,0" delay="1.3" switch="true" stayactive="true" activations="7" invert="true" simultaneousTriggerers="2" mode="xor" broadcast="false" target="Pawn">
+            <MultiTrigger />
+            ...
+            <MultiTrigger />
+        </MultiTrigger>
+        @endcode
 
     @author
         Damian 'Mozork' Frick
+        Many concepts and loads of inspiration from the Trigger class by Benjamin Knecht.
     */
     class _ObjectsExport MultiTrigger : public StaticEntity, public Tickable
@@ -93,5 +103,5 @@
         public:
             MultiTrigger(BaseObject* creator); //!< Constructor. Registers the objects and initializes default values.
-            ~MultiTrigger(); //!< Destructor.
+            virtual ~MultiTrigger(); //!< Destructor.
 
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a MultiTrigger object through XML.
@@ -105,5 +115,5 @@
             */
             inline void setDelay(float delay)
-                { if(delay > 0) this->delay_= delay; }
+                { if(delay > 0.0f) this->delay_= delay; }
             /**
             @brief Get the delay of the MultiTrigger.
@@ -140,10 +150,4 @@
 
             /**
-            @brief Set the number of activations the MultiTrigger can go through.
-            @param activations The number of activations. -1 denotes infinitely many activations.
-            */
-            inline void setActivations(int activations)
-                { if(activations >= 0 || activations == INF_s) this->remainingActivations_ = activations; }
-            /**
             @brief Get the number of remaining activations of the MultiTrigger.
             @return The number of activations. -1 denotes infinity.
@@ -153,15 +157,15 @@
 
             /**
-            @brief Set the number of objects that are allowed to simultaniously trigger this MultiTrigger.
+            @brief Set the number of objects that are allowed to simultaneously trigger this MultiTrigger.
             @param triggerers The number of objects. -1 denotes infinitely many.
             */
-            inline void setSimultaniousTriggerers(int triggerers)
-                { if(triggerers >= 0 || triggerers == INF_s) this->maxNumSimultaniousTriggerers_ = triggerers; }
-            /**
-            @brief Get the number of objects that are allowed to simultaniously trigger this MultiTriggger.
+            inline void setSimultaneousTriggerers(int triggerers)
+                { if(triggerers >= 0 || triggerers == INF_s) this->maxNumSimultaneousTriggerers_ = triggerers; }
+            /**
+            @brief Get the number of objects that are allowed to simultaneously trigger this MultiTriggger.
             @return Returns the number of objects. -1 denotes infinity.
             */
-            inline int getSimultaniousTriggerers(void)
-                { return this->maxNumSimultaniousTriggerers_; }
+            inline int getSimultaneousTriggerers(void)
+                { return this->maxNumSimultaneousTriggerers_; }
 
             /**
@@ -213,21 +217,29 @@
             inline bool isTarget(BaseObject* target)
                 { if(target == NULL) return true; else return targetMask_.isIncluded(target->getIdentifier()); }
+
+            void addTrigger(MultiTrigger* trigger); //!< Adds a MultiTrigger as a sub-trigger to the trigger.
+            const MultiTrigger* getTrigger(unsigned int index) const; //!< Get the sub-trigger of this MultiTrigger at the given index.
+
+        protected:
+            virtual std::queue<MultiTriggerState*>* letTrigger(void); //!< This method is called by the MultiTrigger to get information about new trigger events that need to be looked at.
+
+            void changeTriggered(BaseObject* originator = NULL); //!< This method can be called by any class inheriting from MultiTrigger to change it's triggered status for a specified originator.
+
+            bool isModeTriggered(BaseObject* triggerer = NULL); //!< Checks whetherx the MultiTrigger is triggered concerning it's sub-triggers.
+            bool isTriggered(BaseObject* triggerer = NULL); //!< Get whether the MultiTrigger is triggered for a given object.
+
+            void fire(bool status, BaseObject* originator = NULL);  //!< Helper method. Creates an Event for the given status and originator and fires it.
+            void broadcast(bool status); //!< Helper method. Broadcasts an Event for every object that is a target.
+
+            /**
+            @brief Set the number of activations the MultiTrigger can go through.
+            @param activations The number of activations. -1 denotes infinitely many activations.
+            */
+            inline void setActivations(int activations)
+                { if(activations >= 0 || activations == INF_s) this->remainingActivations_ = activations; }
+
             void addTargets(const std::string& targets); //!< Add some target to the MultiTrigger.
             void removeTargets(const std::string& targets); //!< Remove some target from the MultiTrigger.
 
-            void addTrigger(MultiTrigger* trigger); //!< Adds a MultiTrigger as a sub-trigger to the trigger.
-            const MultiTrigger* getTrigger(unsigned int index) const; //!< Get the sub-trigger of this MultiTrigger at the given index.
-
-        protected:
-            virtual std::queue<MultiTriggerState*>* letTrigger(void); //!< This method is called by the MultiTrigger to get information about new trigger events that need to be looked at.
-
-            void changeTriggered(BaseObject* originator = NULL); //!< This method can be called by any class inheriting from MultiTrigger to change it's triggered status for a specified originator.
-
-            bool isModeTriggered(BaseObject* triggerer = NULL); //!< Checks whetherx the MultiTrigger is triggered concerning it's sub-triggers.
-            bool isTriggered(BaseObject* triggerer = NULL); //!< Get whether the MultiTrigger is triggered for a given object.
-
-            void fire(bool status, BaseObject* originator = NULL);  //!< Helper method. Creates an Event for the given status and originator and fires it.
-            void broadcast(bool status); //!< Helper method. Broadcasts an Event for every object that is a target.
-
             /**
             @brief Adds the parent of a MultiTrigger.
@@ -243,9 +255,4 @@
             inline ClassTreeMask& getTargetMask(void)
                 { return this->targetMask_; }
-            /**
-            @brief Is called, when the target mask changes.
-            */
-            //TODO: Check if something mus be done here.
-            virtual void notifyMaskUpdate(void) {}
 
         private:
@@ -256,5 +263,5 @@
             static const std::string xor_s;
 
-            void subTrigggerActivityChanged(BaseObject* originator); //!< This method is called by any sub-trigger to advertise changes in it's state to it's parent-trigger.
+            void subTriggerActivityChanged(BaseObject* originator); //!< This method is called by any sub-trigger to advertise changes in it's state to it's parent-trigger.
 
             bool addState(MultiTriggerState* state); //!< Helper method. Adds a state to the state queue, where the state will wait to become active.
@@ -278,5 +285,5 @@
 
             int remainingActivations_; //!< The remaining activations of this MultiTrigger.
-            int maxNumSimultaniousTriggerers_; //!< The maximum number of objects simultaniously trigggering this MultiTrigger.
+            int maxNumSimultaneousTriggerers_; //!< The maximum number of objects simultaneously trigggering this MultiTrigger.
 
             bool bInvertMode_; //!< Bool for the invert-mode, if true the MultiTrigger is inverted.
@@ -285,5 +292,5 @@
             bool bBroadcast_; //!< Bool for the broadcast-mode, if true all triggers go to all possible targets.
 
-            MultiTrigger* parentTrigger_;
+            MultiTrigger* parentTrigger_; //!< The parent-trigger of theis MultiTrigger.
             std::set<MultiTrigger*> subTriggers_; //!< The sub-triggers of this MultiTrigger.
 
Index: code/trunk/src/modules/objects/triggers/MultiTriggerContainer.cc
===================================================================
--- code/trunk/src/modules/objects/triggers/MultiTriggerContainer.cc	(revision 7284)
+++ code/trunk/src/modules/objects/triggers/MultiTriggerContainer.cc	(revision 7301)
@@ -21,5 +21,5 @@
  *
  *   Author:
- *      ...
+ *      Damian 'Mozork' Frick
  *   Co-authors:
  *      ...
@@ -58,5 +58,5 @@
         The creator.
     @param originator
-        A pointer to the originator of the Event, i.e. the MultiTrigger that fired the Event. (or is about to)
+        A pointer to the originator of the Event, i.e. the MultiTrigger that fired the Event. (or is about to fire)
     @param data
         A pointer to the data that should be sent with the container.
Index: code/trunk/src/modules/objects/triggers/MultiTriggerContainer.h
===================================================================
--- code/trunk/src/modules/objects/triggers/MultiTriggerContainer.h	(revision 7284)
+++ code/trunk/src/modules/objects/triggers/MultiTriggerContainer.h	(revision 7301)
@@ -54,5 +54,5 @@
             MultiTriggerContainer(BaseObject* creator); //!< Default constructor. Registers the object and creates an empty container.
             MultiTriggerContainer(BaseObject* creator, MultiTrigger* originator, BaseObject* data); //!< Constructor. Registers the object and sets the input values.
-            ~MultiTriggerContainer(); //!< Destructor.
+            virtual ~MultiTriggerContainer(); //!< Destructor.
 
             /**
