Index: trunk/src/world_entities/camera.cc
===================================================================
--- trunk/src/world_entities/camera.cc	(revision 6341)
+++ trunk/src/world_entities/camera.cc	(revision 6424)
@@ -11,5 +11,5 @@
    ### File Specific:
    main-programmer: Christian Meyer
-   co-programmer: ...
+   co-programmer: Benjamin Grauer
 */
 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
@@ -17,15 +17,8 @@
 #include "camera.h"
 
-#include "world.h"
-#include "world_entity.h"
-#include "vector.h"
-#include "event.h"
 #include "event_handler.h"
 
 using namespace std;
 
-////////////
-// CAMERA //
-////////////
 
 /**
@@ -58,6 +51,5 @@
 */
 Camera::~Camera()
-{
-}
+{}
 
 /**
@@ -115,41 +107,41 @@
   currentMode = mode;
   switch (mode)
-    {
+  {
     default:
     case VIEW_NORMAL:
       this->toFovy = 60.0;
-/*      this->setParentSoft("TrackNode");
-      this->target->setParentSoft("TrackNode"); */
+      /*      this->setParentSoft("TrackNode");
+            this->target->setParentSoft("TrackNode"); */
       this->setRelCoorSoft(-10, 5, 0);
       this->target->setRelCoorSoft(0,0,0);
       break;
     case VIEW_BEHIND:
-//      this->toFovy = 120.0;
-//      this->setRelCoorSoft(Vector(3.5, 0, 0));
-  //    this->target->setRelCoorSoft(Vector(10,0,0));
-
-//       if (!strcmp(this->target->getParent()->getName(), "Player"))
-//         this->target->setParentSoft("TrackNode");
-//       else
-//         this->target->setParentSoft("Player");
-//       this->getParent()->debugNode(0);
-
-//      this->setParent("main-Turret");
-//      this->setParentMode(PNODE_ALL);
-//      this->target->setParentSoft("Player");
+      //      this->toFovy = 120.0;
+      //      this->setRelCoorSoft(Vector(3.5, 0, 0));
+      //    this->target->setRelCoorSoft(Vector(10,0,0));
+
+      //       if (!strcmp(this->target->getParent()->getName(), "Player"))
+      //         this->target->setParentSoft("TrackNode");
+      //       else
+      //         this->target->setParentSoft("Player");
+      //       this->getParent()->debugNode(0);
+
+      //      this->setParent("main-Turret");
+      //      this->setParentMode(PNODE_ALL);
+      //      this->target->setParentSoft("Player");
 
       break;
     case VIEW_FRONT:
       this->toFovy = 120.0;
-/*       this->setParentSoft("Player");
-       this->target->setParentSoft("Player");*/
-       this->setRelCoorSoft(4, 0, 0, 5);
-       this->target->setRelCoorSoft(Vector(10,0,0), 5);
-//      this->target->setRelDirSoft(Quaternion(M_PI/4.0, Vector(0,1,0)));
+      /*       this->setParentSoft("Player");
+             this->target->setParentSoft("Player");*/
+      this->setRelCoorSoft(4, 0, 0, 5);
+      this->target->setRelCoorSoft(Vector(10,0,0), 5);
+      //      this->target->setRelDirSoft(Quaternion(M_PI/4.0, Vector(0,1,0)));
       break;
     case VIEW_LEFT:
       this->toFovy = 90;
-/*      this->setParentSoft("TrackNode");
-      this->target->setParentSoft("TrackNode");*/
+      /*      this->setParentSoft("TrackNode");
+            this->target->setParentSoft("TrackNode");*/
       this->setRelCoorSoft(0, 1, -10, .5);
       this->target->setRelCoorSoft(0,0,0);
@@ -157,6 +149,6 @@
     case VIEW_RIGHT:
       this->toFovy = 90;
-/*      this->setParentSoft("TrackNode");
-      this->target->setParentSoft("TrackNode");*/
+      /*      this->setParentSoft("TrackNode");
+            this->target->setParentSoft("TrackNode");*/
       this->setRelCoorSoft(Vector(0, 1, 10));
       this->target->setRelCoorSoft(0,0,0);
@@ -164,9 +156,9 @@
     case VIEW_TOP:
       this->toFovy= 120;
-/*      this->setParentSoft("TrackNode");
-      this->target->setParentSoft("TrackNode");*/
+      /*      this->setParentSoft("TrackNode");
+            this->target->setParentSoft("TrackNode");*/
       this->setRelCoorSoft(Vector(30, 50, 0));
       this->target->setRelCoorSoft(35,0,0);
-    }
+  }
 }
 
@@ -216,5 +208,5 @@
   // switching back to Modeling Matrix
   glMatrixMode (GL_MODELVIEW);
-//  this->target->getParent()->getParent()->debugDraw(0, 2, Vector(1,0,0));
+  //  this->target->getParent()->getParent()->debugDraw(0, 2, Vector(1,0,0));
 }
 
@@ -226,27 +218,27 @@
 {
   if( event.type == KeyMapper::PEV_VIEW0)
-    {
-      this->setViewMode(VIEW_NORMAL);
-    }
+  {
+    this->setViewMode(VIEW_NORMAL);
+  }
   else if( event.type == KeyMapper::PEV_VIEW1)
-    {
-      this->setViewMode(VIEW_BEHIND);
-    }
+  {
+    this->setViewMode(VIEW_BEHIND);
+  }
   else if( event.type == KeyMapper::PEV_VIEW2)
-    {
-      this->setViewMode(VIEW_FRONT);
-    }
+  {
+    this->setViewMode(VIEW_FRONT);
+  }
   else if( event.type == KeyMapper::PEV_VIEW3)
-    {
-      this->setViewMode(VIEW_LEFT);
-    }
+  {
+    this->setViewMode(VIEW_LEFT);
+  }
   else if( event.type == KeyMapper::PEV_VIEW4)
-    {
-      this->setViewMode(VIEW_RIGHT);
-    }
+  {
+    this->setViewMode(VIEW_RIGHT);
+  }
   else if( event.type == KeyMapper::PEV_VIEW5)
-    {
-      this->setViewMode(VIEW_TOP);
-    }
+  {
+    this->setViewMode(VIEW_TOP);
+  }
 }
 
@@ -260,5 +252,5 @@
 {
   this->setClassID(CL_CAMERA_TARGET, "CameraTarget");
-//  this->setParentMode(PNODE_MOVEMENT);
-}
-
+  //  this->setParentMode(PNODE_MOVEMENT);
+}
+
Index: trunk/src/world_entities/power_ups/laser_power_up.cc
===================================================================
--- trunk/src/world_entities/power_ups/laser_power_up.cc	(revision 6341)
+++ trunk/src/world_entities/power_ups/laser_power_up.cc	(revision 6424)
@@ -19,4 +19,5 @@
 #include "factory.h"
 #include "state.h"
+#include "network_game_manager.h"
 
 #include "primitive_model.h"
@@ -118,2 +119,40 @@
 }
 
+int LaserPowerUp::writeBytes( const byte * data, int length, int sender )
+{
+  setRequestedSync( false );
+  setIsOutOfSync( false );
+
+  SYNCHELP_READ_BEGIN();
+
+  SYNCHELP_READ_FKT( PowerUp::writeState );
+
+  return SYNCHELP_READ_N;
+}
+
+
+
+int LaserPowerUp::readBytes( byte * data, int maxLength, int * reciever )
+{
+  if ( isOutOfSync() && !requestedSync() && this->getHostID()!=this->getOwner() )
+  {
+    (NetworkGameManager::getInstance())->sync( this->getUniqueID(), this->getOwner() );
+    setRequestedSync( true );
+  }
+
+  int rec = this->getRequestSync();
+  if ( rec > 0 )
+  {
+    *reciever = rec;
+
+    SYNCHELP_WRITE_BEGIN();
+
+    SYNCHELP_WRITE_FKT( PowerUp::readState );
+
+    return SYNCHELP_WRITE_N;
+  }
+
+  *reciever = 0;
+  return 0;
+}
+
Index: trunk/src/world_entities/power_ups/laser_power_up.h
===================================================================
--- trunk/src/world_entities/power_ups/laser_power_up.h	(revision 6341)
+++ trunk/src/world_entities/power_ups/laser_power_up.h	(revision 6424)
@@ -23,4 +23,7 @@
   virtual void draw() const;
 
+  virtual int writeBytes(const byte* data, int length, int sender);
+  virtual int readBytes(byte* data, int maxLength, int * reciever );
+
   private:
    void init();
Index: trunk/src/world_entities/power_ups/param_power_up.cc
===================================================================
--- trunk/src/world_entities/power_ups/param_power_up.cc	(revision 6341)
+++ trunk/src/world_entities/power_ups/param_power_up.cc	(revision 6424)
@@ -25,4 +25,5 @@
 #include "factory.h"
 #include "load_param.h"
+#include "network_game_manager.h"
 
 using namespace std;
@@ -53,4 +54,5 @@
 void ParamPowerUp::init()
 {
+  this->setClassID(CL_PARAM_POWER_UP, "ParamPowerUp");
   this->value = 0;
   this->max_value = 0;
@@ -63,5 +65,7 @@
   static_cast<PowerUp*>(this)->loadParams(root);
   LoadParam(root, "type", this, ParamPowerUp, setType);
-  if(root->FirstChildElement("value") != NULL) {
+
+  if( root != NULL && root->FirstChildElement("value") != NULL) {
+
     LoadParam(root, "value", this, ParamPowerUp, setValue);
   }
@@ -116,3 +120,61 @@
 }
 
+int ParamPowerUp::writeBytes( const byte * data, int length, int sender )
+{
+  setRequestedSync( false );
+  setIsOutOfSync( false );
 
+  SYNCHELP_READ_BEGIN();
+
+  SYNCHELP_READ_FKT( PowerUp::writeState );
+
+  int i;
+  SYNCHELP_READ_INT( i );
+  this->type = (EnumParamPowerUpType)i;
+  SYNCHELP_READ_INT( this->value );
+
+  if ( this->value != 0 )
+  {
+    SYNCHELP_READ_INT( this->min_value );
+    SYNCHELP_READ_INT( this->max_value );
+  }
+
+  return SYNCHELP_READ_N;
+}
+
+
+
+int ParamPowerUp::readBytes( byte * data, int maxLength, int * reciever )
+{
+  if ( isOutOfSync() && !requestedSync() && this->getHostID()!=this->getOwner() )
+  {
+    (NetworkGameManager::getInstance())->sync( this->getUniqueID(), this->getOwner() );
+    setRequestedSync( true );
+  }
+
+  int rec = this->getRequestSync();
+  if ( rec > 0 )
+  {
+    *reciever = rec;
+
+    SYNCHELP_WRITE_BEGIN();
+
+    SYNCHELP_WRITE_FKT( PowerUp::readState );
+
+    int i = this->type;
+    SYNCHELP_WRITE_INT( i );
+    SYNCHELP_WRITE_INT( this->value );
+
+    if ( this->value != 0 )
+    {
+      SYNCHELP_WRITE_INT( this->min_value );
+      SYNCHELP_WRITE_INT( this->max_value );
+    }
+
+    return SYNCHELP_WRITE_N;
+  }
+
+  *reciever = 0;
+  return 0;
+}
+
Index: trunk/src/world_entities/power_ups/param_power_up.h
===================================================================
--- trunk/src/world_entities/power_ups/param_power_up.h	(revision 6341)
+++ trunk/src/world_entities/power_ups/param_power_up.h	(revision 6424)
@@ -30,4 +30,7 @@
   int getValue();
 
+  virtual int writeBytes(const byte* data, int length, int sender);
+  virtual int readBytes(byte* data, int maxLength, int * reciever );
+
 protected:
   virtual void respawn();
Index: trunk/src/world_entities/power_ups/power_up.cc
===================================================================
--- trunk/src/world_entities/power_ups/power_up.cc	(revision 6341)
+++ trunk/src/world_entities/power_ups/power_up.cc	(revision 6424)
@@ -25,4 +25,6 @@
 PowerUp::PowerUp(float r, float g, float b)
 {
+  this->setClassID(CL_POWER_UP, "PowerUp");
+
   this->respawnType = RESPAWN_NONE;
 /*  if(!PowerUp::sphereModel) {*/
@@ -52,5 +54,5 @@
 void PowerUp::collidesWith (WorldEntity* entity, const Vector& location)
 {
- if(entity->isA(CL_EXTENDABLE))
+  if(entity->isA(CL_EXTENDABLE))
   {
     if(dynamic_cast<Extendable*>(entity)->pickup(this))
@@ -94,2 +96,28 @@
 }
 
+/**
+ * data copied in data will bee sent to another host
+ * @param data pointer to data
+ * @param maxLength max length of data
+ * @return the number of bytes writen
+ */
+int PowerUp::readState( byte * data, int maxLength )
+{
+  SYNCHELP_WRITE_BEGIN();
+  SYNCHELP_WRITE_FKT( WorldEntity::readState );
+  return SYNCHELP_WRITE_N;
+}
+
+/**
+ * Writes data from network containing information about the state
+ * @param data pointer to data
+ * @param length length of data
+ * @param sender hostID of sender
+ */
+int PowerUp::writeState( const byte * data, int length, int sender )
+{
+  SYNCHELP_READ_BEGIN();
+  SYNCHELP_READ_FKT( WorldEntity::writeState );
+  return SYNCHELP_READ_N;
+}
+
Index: trunk/src/world_entities/power_ups/power_up.h
===================================================================
--- trunk/src/world_entities/power_ups/power_up.h	(revision 6341)
+++ trunk/src/world_entities/power_ups/power_up.h	(revision 6424)
@@ -26,4 +26,7 @@
   void setRespawnType(const char* type);
 
+  int       writeState(const byte* data, int length, int sender);
+  int       readState(byte* data, int maxLength );
+
 protected:
   PowerUp(float r, float g, float b);
Index: trunk/src/world_entities/power_ups/turret_power_up.cc
===================================================================
--- trunk/src/world_entities/power_ups/turret_power_up.cc	(revision 6341)
+++ trunk/src/world_entities/power_ups/turret_power_up.cc	(revision 6424)
@@ -18,4 +18,5 @@
 #include "turret_power_up.h"
 #include "factory.h"
+#include "network_game_manager.h"
 #include "state.h"
 
@@ -118,2 +119,39 @@
 }
 
+int TurretPowerUp::writeBytes( const byte * data, int length, int sender )
+{
+  setRequestedSync( false );
+  setIsOutOfSync( false );
+
+  SYNCHELP_READ_BEGIN();
+
+  SYNCHELP_READ_FKT( PowerUp::writeState );
+
+  return SYNCHELP_READ_N;
+}
+
+
+
+int TurretPowerUp::readBytes( byte * data, int maxLength, int * reciever )
+{
+  if ( isOutOfSync() && !requestedSync() && this->getHostID()!=this->getOwner() )
+  {
+    (NetworkGameManager::getInstance())->sync( this->getUniqueID(), this->getOwner() );
+    setRequestedSync( true );
+  }
+
+  int rec = this->getRequestSync();
+  if ( rec > 0 )
+  {
+    *reciever = rec;
+
+    SYNCHELP_WRITE_BEGIN();
+
+    SYNCHELP_WRITE_FKT( PowerUp::readState );
+
+    return SYNCHELP_WRITE_N;
+  }
+
+  *reciever = 0;
+  return 0;
+}
Index: trunk/src/world_entities/power_ups/turret_power_up.h
===================================================================
--- trunk/src/world_entities/power_ups/turret_power_up.h	(revision 6341)
+++ trunk/src/world_entities/power_ups/turret_power_up.h	(revision 6424)
@@ -23,4 +23,7 @@
   virtual void draw() const;
 
+  virtual int writeBytes(const byte* data, int length, int sender);
+  virtual int readBytes(byte* data, int maxLength, int * reciever );
+
   private:
    void init();
Index: trunk/src/world_entities/power_ups/weapon_power_up.cc
===================================================================
--- trunk/src/world_entities/power_ups/weapon_power_up.cc	(revision 6341)
+++ trunk/src/world_entities/power_ups/weapon_power_up.cc	(revision 6424)
@@ -20,4 +20,5 @@
 #include "state.h"
 #include "list.h"
+#include "network_game_manager.h"
 
 #include "primitive_model.h"
@@ -85,2 +86,44 @@
   this->weapon = dynamic_cast<Weapon*>(Factory::fabricate(name));
 }
+
+int WeaponPowerUp::writeBytes( const byte * data, int length, int sender )
+{
+  setRequestedSync( false );
+  setIsOutOfSync( false );
+
+  SYNCHELP_READ_BEGIN();
+
+  SYNCHELP_READ_FKT( PowerUp::writeState );
+
+  //TODO: sync weapon class ( see loadParams )
+
+  return SYNCHELP_READ_N;
+}
+
+
+
+int WeaponPowerUp::readBytes( byte * data, int maxLength, int * reciever )
+{
+  if ( isOutOfSync() && !requestedSync() && this->getHostID()!=this->getOwner() )
+  {
+    (NetworkGameManager::getInstance())->sync( this->getUniqueID(), this->getOwner() );
+    setRequestedSync( true );
+  }
+
+  int rec = this->getRequestSync();
+  if ( rec > 0 )
+  {
+    *reciever = rec;
+
+    SYNCHELP_WRITE_BEGIN();
+
+    SYNCHELP_WRITE_FKT( PowerUp::readState );
+
+    //TODO: sync weapon class ( see loadParams )
+
+    return SYNCHELP_WRITE_N;
+  }
+
+  *reciever = 0;
+  return 0;
+}
Index: trunk/src/world_entities/power_ups/weapon_power_up.h
===================================================================
--- trunk/src/world_entities/power_ups/weapon_power_up.h	(revision 6341)
+++ trunk/src/world_entities/power_ups/weapon_power_up.h	(revision 6424)
@@ -22,4 +22,7 @@
   void setWeaponClass(const char* name);
 
+  virtual int writeBytes(const byte* data, int length, int sender);
+  virtual int readBytes(byte* data, int maxLength, int * reciever );
+
 protected:
   virtual void respawn();
Index: trunk/src/world_entities/space_ships/space_ship.cc
===================================================================
--- trunk/src/world_entities/space_ships/space_ship.cc	(revision 6341)
+++ trunk/src/world_entities/space_ships/space_ship.cc	(revision 6424)
@@ -31,4 +31,6 @@
 #include "key_mapper.h"
 #include "event_handler.h"
+
+#include "network_game_manager.h"
 
 #include "power_ups/weapon_power_up.h"
@@ -121,5 +123,5 @@
   PRINTF(4)("SPACESHIP INIT\n");
 
-  //  EventHandler::getInstance()->grabEvents(true);
+    EventHandler::getInstance()->grabEvents(true);
 
   bUp = bDown = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = false;
@@ -516,2 +518,39 @@
   }
 }
+
+
+int SpaceShip::writeBytes( const byte * data, int length, int sender )
+{
+  setRequestedSync( false );
+  setIsOutOfSync( false );
+
+  SYNCHELP_READ_BEGIN();
+
+  SYNCHELP_READ_FKT( WorldEntity::writeState );
+
+  return SYNCHELP_READ_N;
+}
+
+int SpaceShip::readBytes( byte * data, int maxLength, int * reciever )
+{
+  if ( isOutOfSync() && !requestedSync() && this->getHostID()!=this->getOwner() )
+  {
+    (NetworkGameManager::getInstance())->sync( this->getUniqueID(), this->getOwner() );
+    setRequestedSync( true );
+  }
+
+  int rec = this->getRequestSync();
+  if ( rec > 0 )
+  {
+    *reciever = rec;
+
+    SYNCHELP_WRITE_BEGIN();
+
+    SYNCHELP_WRITE_FKT( WorldEntity::readState );
+
+    return SYNCHELP_WRITE_N;
+  }
+
+  *reciever = 0;
+  return 0;
+}
Index: trunk/src/world_entities/space_ships/space_ship.h
===================================================================
--- trunk/src/world_entities/space_ships/space_ship.h	(revision 6341)
+++ trunk/src/world_entities/space_ships/space_ship.h	(revision 6424)
@@ -44,4 +44,7 @@
     bool pickup(PowerUp* powerUp);
 
+    virtual int       writeBytes(const byte* data, int length, int sender);
+    virtual int       readBytes(byte* data, int maxLength, int * reciever);
+
 
   private:
Index: trunk/src/world_entities/spawning_point.cc
===================================================================
--- trunk/src/world_entities/spawning_point.cc	(revision 6341)
+++ trunk/src/world_entities/spawning_point.cc	(revision 6424)
@@ -16,8 +16,10 @@
 
 #include "spawning_point.h"
+
 #include "load_param.h"
 #include "factory.h"
+
 #include "compiler.h"
-#include "world.h" /* only temp. until the object manager is implemented*/
+
 
 /**
@@ -97,6 +99,7 @@
             this->frequency, this->seed);
   BaseObject* spawningEntity = Factory::fabricate(this->classID);
-  if( likely(this->world != NULL))
-    this->world->spawn(dynamic_cast<WorldEntity*>(spawningEntity));
+
+//   if( likely(this->world != NULL))
+//     this->world->spawn(dynamic_cast<WorldEntity*>(spawningEntity));
 }
 
Index: trunk/src/world_entities/weapons/ground_turret.cc
===================================================================
--- trunk/src/world_entities/weapons/ground_turret.cc	(revision 6341)
+++ trunk/src/world_entities/weapons/ground_turret.cc	(revision 6424)
@@ -119,20 +119,6 @@
 void GroundTurret::draw () const
 {
-  glMatrixMode(GL_MODELVIEW);
-  glPushMatrix();
-  float matrix[4][4];
-
-  /* translate */
-  glTranslatef (this->getAbsCoor ().x,
-                this->getAbsCoor ().y,
-                this->getAbsCoor ().z);
-  /* rotate */
-  this->getAbsDir().matrix(matrix);
-  glMultMatrixf((float*)matrix);
-
-  if (this->getModel())
-    this->getModel()->draw();
-
-  glPopMatrix();
+  WorldEntity::draw();
+
   if (this->left != NULL)
     this->left->draw();
Index: trunk/src/world_entities/world_entity.cc
===================================================================
--- trunk/src/world_entities/world_entity.cc	(revision 6341)
+++ trunk/src/world_entities/world_entity.cc	(revision 6424)
@@ -35,4 +35,5 @@
     ->defaultValues(2, "models/ships/fighter.obj", 1.0);
 
+SHELL_COMMAND(debugEntity, WorldEntity, debugWE);
 
 /**
@@ -48,4 +49,6 @@
 
   this->obbTree = NULL;
+
+  this->md2TextureFileName = NULL;
 
   if (root != NULL)
@@ -105,4 +108,5 @@
 void WorldEntity::loadModel(const char* fileName, float scaling, unsigned int modelNumber)
 {
+  this->scaling = scaling;
   if ( fileName != NULL && strcmp(fileName, "") )
   {
@@ -123,5 +127,9 @@
       return;
     }
-
+    if (scaling == 0.0)
+    {
+      scaling = 1.0;
+      PRINTF(1)("YOU GAVE ME A CRAPY SCALE resetting to 1\n");
+    }
     if(strstr(fileName, ".obj"))
     {
@@ -343,4 +351,23 @@
 }
 
+
+/**
+ * Debug the WorldEntity
+ */
+void WorldEntity::debugEntity() const
+{
+  PRINT(0)("WorldEntity %s::%s  (DEBUG)\n", this->getClassName(), this->getName());
+  this->debugNode();
+  PRINT(0)("List: %s ; ModelCount %d - ", ObjectManager::OMListToString(this->objectListNumber) , this->models.size());
+  for (unsigned int i = 0; i < this->models.size(); i++)
+  {
+    if (models[i] != NULL)
+      PRINT(0)(" : %d:%s", i, this->models[i]->getName());
+  }
+  PRINT(0)("\n");
+
+}
+
+
 /**
  * Writes data from network containing information about the state
@@ -359,13 +386,22 @@
   SYNCHELP_READ_FLOAT( scaling );
   //check if modelFileName is relative to datadir or absolute
-  if ( strstr(modelFileName, ResourceManager::getInstance()->getDataDir()) )
-  {
-    loadModel( modelFileName+strlen(ResourceManager::getInstance()->getDataDir()), scaling );
-  }
-  else
-  {
-    loadModel( modelFileName, scaling );
+
+  if ( strcmp(modelFileName, "") )
+  {
+
+    if ( strstr(modelFileName, ResourceManager::getInstance()->getDataDir()) )
+    {
+      loadModel( modelFileName+strlen(ResourceManager::getInstance()->getDataDir()), scaling );
+    }
+    else
+    {
+      loadModel( modelFileName, scaling );
+    }
   }
   delete[] modelFileName;
+
+  SYNCHELP_READ_STRINGM( modelFileName );
+  if ( strcmp(modelFileName, "") )
+    this->md2TextureFileName = modelFileName;
 
   return SYNCHELP_READ_N;
@@ -386,4 +422,13 @@
   SYNCHELP_WRITE_STRING( getModel( 0 )->getName() );
   SYNCHELP_WRITE_FLOAT( scaling );
+  if ( this->md2TextureFileName!=NULL && strcmp(this->md2TextureFileName, "") )
+  {
+    SYNCHELP_WRITE_STRING(this->md2TextureFileName);
+  }
+  else
+  {
+    SYNCHELP_WRITE_STRING("");
+  }
+
   return SYNCHELP_WRITE_N;
 }
Index: trunk/src/world_entities/world_entity.h
===================================================================
--- trunk/src/world_entities/world_entity.h	(revision 6341)
+++ trunk/src/world_entities/world_entity.h	(revision 6424)
@@ -60,4 +60,9 @@
   void drawBVTree(unsigned int depth, int drawMode) const;
 
+
+  void debugWE() { this->debugEntity(); };  ///FIXME
+  void debugEntity() const;
+
+
   /* @returns the Count of Faces on this WorldEntity */
   //unsigned int getFaceCount () const { return (this->model != NULL)?this->model->getFaceCount():0; };
