Index: /code/trunk/data/levels/The Time Machine.oxw
===================================================================
--- /code/trunk/data/levels/The Time Machine.oxw	(revision 7673)
+++ /code/trunk/data/levels/The Time Machine.oxw	(revision 7674)
@@ -173,92 +173,4 @@
 
 <!--Creating Spaceships_____________________________________________________________________________________________________________________________________________________________________-->
-    
-<?lua for i=0,5,1 do 
-    y=math.random(-500,500)
-    z=math.random(-1000,1000)
-    y2=math.random(-500,500)
-    z2=math.random(-1000,1000)
-    health=230
-    addh=100
-?>
-    
-        <EventTrigger name="BotDied" >
-            <events>
-                <trigger>
-                    <SpaceShip position="-4000,<?lua print(y) ?>,<?lua print(z) ?>" lookat="1000,<?lua print(y) ?>,<?lua print(z) ?>" health=<?lua print(health) ?> maxhealth=<?lua print(health) ?> initialhealth=<?lua print(health) ?> >
-                        <templates>
-                            <Template link=spaceshipassff />
-                         </templates>
-                          <controller>
-                            <WaypointPatrolController alertnessradius=1000 team=0 active=1 >
-                                <waypoints>
-                                    <Model mesh="cube.mesh" scale=0 position="1000,<?lua print(math.random(-1000,1000)) ?>,<?lua print(math.random(-1000,1000)) ?>" />
-                                </waypoints>
-                                <events>
-                                    <activity>
-                                        <Trigger mode=or>
-                                            <EventTrigger invert=true>
-                                                <events>
-                                                    <trigger>
-                                                        <EventListener event=EnterTimeMachine />
-                                                    </trigger>
-                                                </events>
-                                            </EventTrigger>
-                                            <EventTrigger>
-                                                <events>
-                                                    <trigger>
-                                                        <EventListener event=trigger2 />
-                                                    </trigger>
-                                                </events>
-                                            </EventTrigger>
-                                        </Trigger>
-                                    </activity>
-                                </events>
-                            </WaypointPatrolController>
-                          </controller>
-                    </SpaceShip>
-                </trigger>
-            </events>
-        </EventTrigger>
-
-        <EventTrigger name="BotDied" >
-            <events>
-                <trigger>
-                    <SpaceShip position="4000,<?lua print(y2) ?>,<?lua print(z2) ?>" lookat="-1000,<?lua print(y2) ?>, <?lua print(z2) ?>" health=<?lua print(health+addh) ?> maxhealth=<?lua print(health+addh) ?> initialhealth=<?lua print(health+addh) ?> >
-                        <templates>
-                            <Template link=spaceshippirate />
-                         </templates>
-                          <controller>
-                            <WaypointPatrolController alertnessradius=1000 team=1 active=1 >
-                                <waypoints>
-                                    <Model mesh="cube.mesh" scale=0 position="-1000,<?lua print(math.random(-1000,1000)) ?>, <?lua print(math.random(-1000,1000)) ?>" />
-                                </waypoints>
-                                <events>
-                                    <activity>
-                                        <Trigger mode=or>
-                                            <EventTrigger invert=true>
-                                                <events>
-                                                    <trigger>
-                                                        <EventListener event=EnterTimeMachine />
-                                                    </trigger>
-                                                </events>
-                                            </EventTrigger>
-                                            <EventTrigger>
-                                                <events>
-                                                    <trigger>
-                                                        <EventListener event=trigger2 />
-                                                    </trigger>
-                                                </events>
-                                            </EventTrigger>
-                                        </Trigger>
-                                    </activity>
-                                </events>
-                            </WaypointPatrolController>
-                          </controller>
-                    </SpaceShip>
-                </trigger>
-            </events>
-        </EventTrigger>
-<?lua end ?>
 
 <!--Creating Spaceships_____END_____________________________________________________________________________________________________________________________________________________________-->
Index: /code/trunk/src/modules/objects/ForceField.cc
===================================================================
--- /code/trunk/src/modules/objects/ForceField.cc	(revision 7673)
+++ /code/trunk/src/modules/objects/ForceField.cc	(revision 7674)
@@ -42,6 +42,6 @@
     CreateFactory(ForceField);
     
-    /*static*/ const std::string modeStringNormal_s = "tube";
-    /*static*/ const std::string modeStringSphere_s = "sphere";
+    /*static*/ const std::string ForceField::modeTube_s = "tube";
+    /*static*/ const std::string ForceField::modeSphere_s = "sphere";
 
     ForceField::ForceField(BaseObject* creator) : StaticEntity(creator)
@@ -54,5 +54,5 @@
         this->diameter_ = 500;
         this->length_ = 5000;
-        this->mode_ = ForceFieldMode::tube;
+        this->mode_ = forceFieldMode::tube;
     }
 
@@ -70,12 +70,13 @@
         XMLPortParam(ForceField, "length"  , setLength  , getLength  , xmlelement, mode).defaultValues(2000);
         XMLPortParam(ForceField, "mode", setMode, getMode, xmlelement, mode);
+        COUT(0) << "ForceField created " << this->velocity_ << " " << this->diameter_ << " " << this->radius_ << " " << this->length_ << " " << this->halfLength_ << " " << this->getMode() << std::endl;
     }
 
     void ForceField::tick(float dt)
     {
-        // Iterate over all objects that could possibly be affected by the ForceField.
-        for (ObjectList<MobileEntity>::iterator it = ObjectList<MobileEntity>::begin(); it != ObjectList<MobileEntity>::end(); ++it)
+        if(this->mode_ == forceFieldMode::tube)
         {
-            if(this->mode_ == ForceFieldMode::tube)
+            // Iterate over all objects that could possibly be affected by the ForceField.
+            for (ObjectList<MobileEntity>::iterator it = ObjectList<MobileEntity>::begin(); it != ObjectList<MobileEntity>::end(); ++it)
             {
                 // The direction of the orientation of the force field.
@@ -89,5 +90,5 @@
                 // The object is outside of the length of the ForceField.
                 if(distanceVector.length() > this->halfLength_)
-                    return;
+                    continue;
 
                 // The distance of the object form the orientation vector. (Or rather the smallest distance from the orientation vector)
@@ -96,11 +97,15 @@
                 // If the object in a tube of radius diameter/2 around the direction of orientation.
                 if(distanceFromDirectionVector >= this->radius_)
-                    return;
+                    continue;
 
                 // Apply a force to the object in the direction of the orientation.
                 // The force is highest when the object is directly on the direction vector, with a linear decrease, finally reaching zero, when distanceFromDirectionVector = radius.
-                it->applyCentralForce(((this->radius_ - distanceFromDirectionVector)/(this->radius_)) * this->velocity_ * direction);
+                it->applyCentralForce((this->radius_ - distanceFromDirectionVector)/this->radius_ * this->velocity_ * direction);
             }
-            else if(this->mode_ == ForceFieldMode::sphere)
+        }
+        else if(this->mode_ == forceFieldMode::sphere)
+        {
+            // Iterate over all objects that could possibly be affected by the ForceField.
+            for (ObjectList<MobileEntity>::iterator it = ObjectList<MobileEntity>::begin(); it != ObjectList<MobileEntity>::end(); ++it)
             {
                 Vector3 distanceVector = it->getWorldPosition() - this->getWorldPosition();
@@ -117,12 +122,12 @@
     void ForceField::setMode(const std::string& mode)
     {
-        if(mode == ForceField::modeStringTube_s)
-            this->mode_ = ForceFieldMode::tube;
-        else if(mode == ForceField::modeStringSphere_s)
-            this->mode_ = ForceFieldMode::sphere;
+        if(mode == ForceField::modeTube_s)
+            this->mode_ = forceFieldMode::tube;
+        else if(mode == ForceField::modeSphere_s)
+            this->mode_ = forceFieldMode::sphere;
         else
         {
             COUT(2) << "Wrong mode '" << mode << "' in ForceField. Setting to 'tube'." << std::endl;
-            this->mode_ = ForceFieldMode::tube;
+            this->mode_ = forceFieldMode::tube;
         }
     }
@@ -132,10 +137,10 @@
         switch(this->mode_)
         {
-            case ForceFieldMode::tube:
-                return ForceField::modeStringTube_s;
-            case ForceFieldMode::sphere:
-                return ForceField::modeStringSphere_s;
+            case forceFieldMode::tube:
+                return ForceField::modeTube_s;
+            case forceFieldMode::sphere:
+                return ForceField::modeSphere_s;
             default:
-                return ForceField::modeStringTube_s;
+                return ForceField::modeTube_s;
         }
     }
Index: /code/trunk/src/modules/objects/ForceField.h
===================================================================
--- /code/trunk/src/modules/objects/ForceField.h	(revision 7673)
+++ /code/trunk/src/modules/objects/ForceField.h	(revision 7674)
@@ -56,5 +56,5 @@
     @inGroup Objects
     */
-    namespace ForceFieldMode
+    namespace forceFieldMode
     {
         enum Value {
@@ -116,6 +116,6 @@
 
         private:
-            static const std::string modeStringTube_s;
-            static const std::string modeStringSphere_s;
+            static const std::string modeTube_s;
+            static const std::string modeSphere_s;
         
             float velocity_;
@@ -124,5 +124,5 @@
             float length_;
             float halfLength_;
-            ForceFieldMode::Value mode_;
+            forceFieldMode::Value mode_;
   };
 }
