Index: code/branches/portals2/src/modules/portals/PortalEndPoint.cc
===================================================================
--- code/branches/portals2/src/modules/portals/PortalEndPoint.cc	(revision 8466)
+++ code/branches/portals2/src/modules/portals/PortalEndPoint.cc	(revision 8511)
@@ -14,5 +14,5 @@
     std::map<unsigned int, PortalEndPoint *> PortalEndPoint::idMap_s;
 
-    PortalEndPoint::PortalEndPoint(BaseObject* creator) : StaticEntity(creator), id_(0), trigger_(new DistanceMultiTrigger(this))
+    PortalEndPoint::PortalEndPoint(BaseObject* creator) : StaticEntity(creator), id_(0), trigger_(new DistanceMultiTrigger(this)), reenterDelay_(0)
     {
         RegisterObject(PortalEndPoint);
@@ -32,5 +32,6 @@
         XMLPortParam(PortalEndPoint, "id", setID, getID, xmlelement, mode);
         XMLPortParam(PortalEndPoint, "design", setTemplate, getTemplate, xmlelement, mode);
-        XMLPortParamExtern(PortalEndPoint, DistanceMultiTrigger, this->trigger_, "distance", setDistance, getDistance, xmlelement, mode).defaultValues("50");
+        XMLPortParam(PortalEndPoint, "reenterDelay", setReenterDelay, getReenterDelay, xmlelement, mode);
+        XMLPortParamExtern(PortalEndPoint, DistanceMultiTrigger, this->trigger_, "distance", setDistance, getDistance, xmlelement, mode);
         XMLPortParamLoadOnly(PortalEndPoint, "target", setTarget, xmlelement, mode).defaultValues("Pawn");
         
@@ -63,5 +64,5 @@
         if(originatingTrigger == 0)
         {
-            COUT(1) << "originator no DistanceMultiTrigger\n" << std::endl;
+            // COUT(1) << "originator no DistanceMultiTrigger\n" << std::endl;
             return true;
         }
@@ -73,5 +74,5 @@
         if(bTriggered)
         {
-            if(this->recentlyJumpedOut_.find(entity) == this->recentlyJumpedOut_.end())  // only enter the portal if not just jumped out of it
+            if(this->letsEnter(entity))  // only enter the portal if not just (this very moment) jumped out of it, or if the reenterDelay expired
             {
                 PortalLink::use(entity, this);
@@ -86,6 +87,22 @@
     }
 
+    bool PortalEndPoint::letsEnter(MobileEntity* entity)
+    {
+        // not allowed to enter if reenterDelay hasn't expired yet
+        std::map<MobileEntity *, time_t>::const_iterator time = this->jumpOutTimes_.find(entity);
+        if(time != this->jumpOutTimes_.end() && std::difftime(std::time(0),time->second) < this->reenterDelay_)
+            return false;
+
+        // not allowed to enter if jumped out of this portal and not left its activation radius yet
+        std::set<MobileEntity *>::const_iterator recent = this->recentlyJumpedOut_.find(entity);
+        if(recent != this->recentlyJumpedOut_.end())
+            return false;
+        
+        return true;
+    }
+
     void PortalEndPoint::jumpOut(MobileEntity* entity)
     {
+        this->jumpOutTimes_[entity] = std::time(0);
         this->recentlyJumpedOut_.insert(entity);
         
Index: code/branches/portals2/src/modules/portals/PortalEndPoint.h
===================================================================
--- code/branches/portals2/src/modules/portals/PortalEndPoint.h	(revision 8466)
+++ code/branches/portals2/src/modules/portals/PortalEndPoint.h	(revision 8511)
@@ -18,4 +18,5 @@
 #include "objects/triggers/DistanceMultiTrigger.h"
 #include "core/EventIncludes.h"
+#include <ctime>
 
 namespace orxonox
@@ -41,4 +42,12 @@
             void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
             static std::map<unsigned int, PortalEndPoint *> idMap_s; //!< Maps the id of each PortalEndPoint to a pointer to that PortalEndPoint
+            inline void setReenterDelay(unsigned int seconds)
+            {
+                this->reenterDelay_ = seconds;
+            }
+            inline unsigned int getReenterDelay()
+            {
+                return this->reenterDelay_;
+            }
             inline void setID(unsigned int id)
             {
@@ -65,9 +74,7 @@
 
             /*! \brief This function is called each time the DistanceMultiTrigger of this PortalEndPoint changed
-             * \param bTriggered true if the trigger was triggered on, false if the trigger has switched to off
-             * \param trigger the MultiTriggerContainer containing the triggering BaseObject (and trigger_ the portal's MultiDistanceTrigger which we already know)
-             * 
-             * if bTriggered is \c true the triggering entity enters this portal (if it is an entrance)
-             * otherwise the triggering entity is removed from the set of entities who recently jumped out of this portal */
+                \param bTriggered true if the trigger was triggered on, false if the trigger has switched to off
+                \param trigger the MultiTriggerContainer containing the triggering BaseObject (and trigger_ the portal's MultiDistanceTrigger which we already know)
+            */
             bool execute(bool bTriggered, BaseObject* trigger);
 
@@ -75,4 +82,9 @@
              * \param entity The Entity which should jump out of this portal */
             void jumpOut(MobileEntity * entity);
+            
+            /** \brief Tells wether a certain Entity is allowed to enter the PortalEndPoint?
+                @return @c true if the entity not just came out of this portal and the reenterDelay has expired for it, @c false otherwise
+            */
+            bool letsEnter(MobileEntity* entity);
         protected:
             
@@ -84,5 +96,7 @@
             std::string templateName_;            //!< The name of the design template used for this endpoint
 
-            std::set<MobileEntity *> recentlyJumpedOut_; //!< Entities which recently jumped out of this EndPoint, hence they shouldn't be pulled in again if the endpoint is the beginning of a link
+            int reenterDelay_;
+            std::map<MobileEntity *, time_t> jumpOutTimes_;   //!< Stores the time at which a certain MobileEntity @ref jumpOut "jumped out" of this PortalEndPoint
+            std::set<MobileEntity *> recentlyJumpedOut_;
     };
 
Index: code/branches/portals2/src/modules/portals/PortalLink.cc
===================================================================
--- code/branches/portals2/src/modules/portals/PortalLink.cc	(revision 8466)
+++ code/branches/portals2/src/modules/portals/PortalLink.cc	(revision 8511)
@@ -41,10 +41,10 @@
         }
         
-        std::map<PortalEndPoint *, PortalEndPoint *>::iterator endpoint = PortalLink::links_s.find(entrance);
+        std::map<PortalEndPoint *, PortalEndPoint *>::iterator endpoints = PortalLink::links_s.find(entrance);
         
-        if(endpoint == PortalLink::links_s.end())  // entrance has no corresponding exit
+        if(endpoints == PortalLink::links_s.end())  // entrance has no corresponding exit
             return;
         
-        endpoint->second->jumpOut(entity);
+        endpoints->second->jumpOut(entity);
     }
 
