Index: /code/branches/network/src/network/packet/Gamestate.cc
===================================================================
--- /code/branches/network/src/network/packet/Gamestate.cc	(revision 1714)
+++ /code/branches/network/src/network/packet/Gamestate.cc	(revision 1715)
@@ -49,8 +49,7 @@
 }
 
-Gamestate::Gamestate(unsigned char *data, bool compressed, int clientID):
+Gamestate::Gamestate(unsigned char *data, int clientID):
     Packet(data, clientID)
 {
-  compressed_ = compressed;
 }
 
@@ -106,10 +105,10 @@
   //start write gamestate header
   HEADER->packetType = ENUM::Gamestate;
-  assert( *(ENUM::Type *)&data_[ 0 ] == ENUM::Gamestate); 
+  assert( *(ENUM::Type *)(data_) == ENUM::Gamestate); 
   HEADER->normsize = currentsize;
   HEADER->id = id;
   HEADER->diffed = false;
   HEADER->complete = true;
-  compressed_=false;
+  HEADER->compressed = false;
   //stop write gamestate header
   
@@ -121,5 +120,5 @@
 bool Gamestate::spreadData(int mode)
 {
-  assert(data_ && !compressed_ && !HEADER->diffed);
+  assert(data_ && !HEADER->compressed && !HEADER->diffed);
   unsigned int size, objectID, classID;
   unsigned char *mem=data_+sizeof(GamestateHeader);
@@ -167,5 +166,5 @@
 {
   assert(data_);
-  if(compressed_)
+  if(HEADER->compressed)
     return HEADER->compsize+sizeof(GamestateHeader);
   else
@@ -203,4 +202,5 @@
   //copy and modify header
   HEADER->compsize = buffer;
+  HEADER->compressed = true;
   *GAMESTATE_HEADER(ndata) = *HEADER;
   //delete old data
@@ -208,10 +208,9 @@
   //save new data
   data_ = ndata;
-  compressed_ = true;
   return true;
 }
 bool Gamestate::decompressData()
 {
-  assert(compressed_);
+  assert(HEADER->compressed);
   //COUT(4) << "GameStateClient: uncompressing gamestate. id: " << a->id << ", baseid: " << a->base_id << ", normsize: " << a->normsize << ", compsize: " << a->compsize << std::endl;
   int normsize = HEADER->normsize;
@@ -236,5 +235,5 @@
   }
   
-  compressed_ = false;
+  HEADER->compressed = false;
   //copy over the header
   *GAMESTATE_HEADER(ndata) = *HEADER;
@@ -273,5 +272,7 @@
   }
 
-  Gamestate *g = new Gamestate(ndata, false, 0);
+  *GAMESTATE_HEADER(ndata) = *HEADER;
+  GAMESTATE_HEADER(ndata)->diffed = true;
+  Gamestate *g = new Gamestate(ndata, 0);
   return g;
 }
@@ -280,5 +281,5 @@
 {
   assert(this && base);
-  assert(!this->compressed_ && !base->compressed_);
+  assert(!HEADER->compressed && !GAMESTATE_HEADER(base->data_)->compressed);
   //unsigned char *basep = base->getGs()/*, *gs = getGs()*/;
   unsigned char *basep = GAMESTATE_START(base->data_);
@@ -304,6 +305,7 @@
     }
   }
-  
-  Gamestate *g = new Gamestate(ndata, false, 0);
+  *GAMESTATE_HEADER(ndata) = *HEADER;
+  GAMESTATE_HEADER(ndata)->diffed = false;
+  Gamestate *g = new Gamestate(ndata, 0);
   return g;
 }
Index: /code/branches/network/src/network/packet/Gamestate.h
===================================================================
--- /code/branches/network/src/network/packet/Gamestate.h	(revision 1714)
+++ /code/branches/network/src/network/packet/Gamestate.h	(revision 1715)
@@ -47,4 +47,5 @@
   bool diffed; // wheter diffed or not
   bool complete; // wheter it is a complete gamestate or only partial
+  bool compressed;
 };
 
@@ -55,5 +56,5 @@
   public:
     Gamestate();
-    Gamestate(unsigned char *data, bool compressed, int clientID);
+    Gamestate(unsigned char *data, int clientID);
     
     ~Gamestate();
@@ -81,5 +82,4 @@
     //Bytestream *bs_;
     //GamestateHeader *header_;
-    bool compressed_;
 };
 
Index: /code/branches/network/src/network/packet/Packet.cc
===================================================================
--- /code/branches/network/src/network/packet/Packet.cc	(revision 1714)
+++ /code/branches/network/src/network/packet/Packet.cc	(revision 1715)
@@ -111,4 +111,17 @@
     packetMap_[enetPacket_] = this;
   }
+  /*switch( *(ENUM::Type *)(data_ + _PACKETID) )
+  {
+    case ENUM::Acknowledgement:
+    case ENUM::Chat:
+    case ENUM::ClassID:
+    case ENUM::Gamestate:
+    case ENUM::Welcome:
+      COUT(3) << "welcome" << std::endl;
+      p = new Welcome( data, clientID );
+    default:
+      assert(0); //TODO: repair this
+      break;
+  }*/
   network::Host::addPacket( enetPacket_, clientID_);
   enetPacket_ = 0; // otherwise we have a double free because enet already handles the deallocation of the packet
@@ -121,5 +134,5 @@
   Packet *p;
   COUT(3) << "packet type: " << *(ENUM::Type *)&data[_PACKETID] << std::endl;
-  switch( *(ENUM::Type *)&data[_PACKETID] )
+  switch( *(ENUM::Type *)(data + _PACKETID) )
   {
     case ENUM::Acknowledgement:
@@ -138,9 +151,10 @@
       COUT(3) << "gamestate" << std::endl;
       // TODO: remove brackets
-      p = new Gamestate( data, true, clientID );
+      p = new Gamestate( data, clientID );
       break;
     case ENUM::Welcome:
       COUT(3) << "welcome" << std::endl;
       p = new Welcome( data, clientID );
+      break;
     default:
       assert(0); //TODO: repair this
