Index: branches/presentation/src/world_entities/WorldEntities.am
===================================================================
--- branches/presentation/src/world_entities/WorldEntities.am	(revision 9221)
+++ branches/presentation/src/world_entities/WorldEntities.am	(revision 9222)
@@ -7,4 +7,5 @@
                 world_entities/npcs/generic_npc.cc \
                 world_entities/npcs/door.cc \
+                world_entities/npcs/gate.cc \
                 world_entities/npcs/repair_station.cc \
                 world_entities/npcs/attractor_mine.cc \
Index: branches/presentation/src/world_entities/creatures/fps_player.cc
===================================================================
--- branches/presentation/src/world_entities/creatures/fps_player.cc	(revision 9221)
+++ branches/presentation/src/world_entities/creatures/fps_player.cc	(revision 9222)
@@ -170,5 +170,5 @@
   this->damageTicker = 0.0f;
 
-  toList( OM_PLAYERS );
+//   toList( OM_PLAYERS );
 }
 
@@ -289,15 +289,15 @@
 
   //dealing damage
-  
+
   if ( State::isOnline() && SharedNetworkData::getInstance()->isGameServer() )
   {
     this->damageTicker -= time;
-  
+
     if ( this->damageTicker <= 0.0f && this->beFire() )
     {
       this->damageTicker = 0.25;
-    
+
       WorldEntity * victim = aimingSystem->getNearestTarget();
-    
+
       if ( victim )
       {
@@ -486,7 +486,7 @@
   if( State::isOnline())
     toList( OM_PLAYERS );
-  
+
   this->damageTicker = 0.0f;
-  
+
   Playable::respawn();
 }
Index: branches/presentation/src/world_entities/npcs/gate.cc
===================================================================
--- branches/presentation/src/world_entities/npcs/gate.cc	(revision 9222)
+++ branches/presentation/src/world_entities/npcs/gate.cc	(revision 9222)
@@ -0,0 +1,207 @@
+
+
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   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, or (at your option)
+   any later version.
+
+   ### File Specific
+   main-programmer: Patrick Boenzli
+   co-programmer:
+*/
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
+
+
+#include "util/loading/factory.h"
+#include "util/loading/load_param.h"
+
+#include "interactive_model.h"
+
+
+#include "gate.h"
+#include "class_list.h"
+
+#include "effects/explosion.h"
+
+
+
+using namespace std;
+
+
+CREATE_FACTORY(Gate, CL_GATE);
+
+
+
+//! list of all different animations a std md2model supports
+sAnim Gate::animationList[3] =
+{
+ // begin, end, fps, interruptable
+  {   0,  7,  30,  0 },    //!< OPEN
+  {   8, 15,  30,  0 },    //!< CLOSE
+  {  16, 18,  30,  0 }     //!< DIE
+};
+
+
+
+Gate::Gate(const TiXmlElement* root)
+{
+
+  this->setClassID(CL_GATE, "Gate");
+  this->scale = 1.0f;
+  this->actionRadius = 1.0;
+
+  if( root != NULL)
+    this->loadParams(root);
+
+  this->toList(OM_COMMON);
+  this->bLocked = false;
+  this->bOpen = false;
+
+  this->loadMD2Texture("maps/wheel.jpg");
+  this->loadModel("models/creatures/hypergate.md2", this->scale);
+
+  this->setAnimation(GATE_CLOSE, MD2_ANIM_ONCE);
+}
+
+
+Gate::~Gate ()
+{}
+
+
+
+/**
+ * loads the Settings of a MD2Creature from an XML-element.
+ * @param root the XML-element to load the MD2Creature's properties from
+ */
+void Gate::loadParams(const TiXmlElement* root)
+{
+  WorldEntity::loadParams(root);
+
+  LoadParam(root, "action-radius", this, Gate, setActionRadius)
+      .describe("sets the action radius of the door")
+      .defaultValues(3.0);
+  LoadParam(root, "scale", this, Gate, setScale)
+      .describe("sets the scale of the door")
+      .defaultValues(1.0);
+}
+
+
+/**
+ * sets the animatin of this entity
+ */
+void  Gate::setAnimation(int animNum, int playbackMode)
+{
+  if( likely(this->getModel(0) != NULL))
+    ((InteractiveModel*)this->getModel(0))->setAnimation(animationList[animNum].firstFrame,
+                                                         animationList[animNum].lastFrame,
+                                                         animationList[animNum].fps,
+                                                         animationList[animNum].bStoppable,
+                                                         playbackMode);
+}
+
+
+/**
+ * ticks the door
+ * @param time: time since last tick
+ */
+void Gate::tick (float time)
+{
+  if( likely(this->getModel(0) != NULL))
+    ((InteractiveModel*)this->getModel(0))->tick(time);
+
+  if( !this->bOpen)
+  {
+    if( this->checkOpen())
+    {
+      this->open();
+    }
+  }
+  else
+  {
+    if( !this->checkOpen())
+    {
+      this->close();
+    }
+  }
+
+}
+
+
+/**
+ * open the door
+ */
+void Gate::open()
+{
+  if( this->bLocked)
+    return;
+
+  this->setAnimation(GATE_OPEN, MD2_ANIM_ONCE);
+  this->bOpen = true;
+}
+
+
+/**
+ * close the door
+ */
+void Gate::close()
+{
+  this->setAnimation(GATE_CLOSE, MD2_ANIM_ONCE);
+  this->bOpen = false;
+}
+
+
+void Gate::destroy()
+{
+  this->setAnimation(GATE_DIE, MD2_ANIM_ONCE);
+
+  Explosion::explode(this, Vector(10,10,10));
+}
+
+
+/**
+ * checks if the door is open
+ */
+bool Gate::checkOpen()
+{
+
+  std::list<BaseObject*>::const_iterator it;
+  const std::list<BaseObject*>* list = ClassList::getList(CL_PLAYABLE);
+  WorldEntity* entity;
+  float distance;
+
+  if( list == NULL)
+    return false;
+
+  // for all players
+  for( it = list->begin(); it != list->end(); it++)
+  {
+    entity = dynamic_cast<WorldEntity*>(*it);
+
+    distance = fabs((this->getAbsCoor() - entity->getAbsCoor()).len());
+    if( distance < this->actionRadius)
+      return true;
+  }
+
+
+  list = ClassList::getList(CL_GENERIC_NPC);
+  if( list == NULL)
+    return false;
+  for( it = list->begin(); it != list->end(); it++)
+  {
+    entity = dynamic_cast<WorldEntity*>(*it);
+
+    distance = fabs((this->getAbsCoor() - entity->getAbsCoor()).len());
+    if( distance < this->actionRadius)
+      return true;
+  }
+
+  return false;
+}
+
+
+
Index: branches/presentation/src/world_entities/npcs/gate.h
===================================================================
--- branches/presentation/src/world_entities/npcs/gate.h	(revision 9222)
+++ branches/presentation/src/world_entities/npcs/gate.h	(revision 9222)
@@ -0,0 +1,64 @@
+#ifndef _GATE_H
+#define _GATE_H
+
+#include "world_entity.h"
+
+#include "md2/md2Model.h"
+
+class TiXmlElement;
+
+
+//! animation names enumeration
+typedef enum GateAnimType
+{
+  GATE_OPEN = 0,
+  GATE_CLOSE,
+  GATE_DIE,
+
+  GATE_MAX_ANIMATIONS
+};
+
+
+class Gate : public WorldEntity
+{
+  public:
+    Gate(const TiXmlElement* root = NULL);
+    virtual ~Gate ();
+
+    virtual void loadParams(const TiXmlElement* root);
+
+    void setActionRadius(float radius) { this->actionRadius = radius; }
+    void setScale(float scale) { this->scale = scale; }
+
+    void open();
+    void close();
+    void destroy();
+
+    void lock() { this->bLocked = true; }
+    void unlock() { this->bLocked = false; }
+    bool isLocked() const { return this->bLocked; }
+
+
+    virtual void tick (float time);
+
+
+  private:
+    void init();
+    bool checkOpen();
+    void setAnimation(int animNum, int playbackMode = 0);
+
+
+  private:
+    bool           bOpen;             //!< true if the door is open
+    bool           bLocked;           //!< true if this door is locked
+    float          actionRadius;      //!< action radius
+    float          scale;             //!< the scale of the model
+
+    static sAnim   animationList[3];  //!< list of the animations
+
+    bool           bDead;
+
+
+};
+
+#endif /* _GATE_H */
