Index: /code/branches/network/src/network/GameStateManager.cc
===================================================================
--- /code/branches/network/src/network/GameStateManager.cc	(revision 985)
+++ /code/branches/network/src/network/GameStateManager.cc	(revision 986)
@@ -132,7 +132,10 @@
       // run Synchronisable::getData with offset and additional place for 3 ints in between (for ids and length)
       sync=it->getData((retval->data)+offset+3*sizeof(int));
-      *(retval->data+offset)=sync.length;
-      *(retval->data+offset+sizeof(int))=sync.objectID;
-      *(retval->data+offset+2*sizeof(int))=sync.classID;
+      memcpy(retval->data+offset, (void *)&sync.length, sizeof(int));
+      //*(retval->data+offset)=sync.length;
+      memcpy(retval->data+offset+sizeof(int), (void *)&sync.objectID, sizeof(int));
+      //*(retval->data+offset+sizeof(int))=sync.objectID;
+      memcpy(retval->data+offset+2*sizeof(int), (void *)&sync.classID, sizeof(int));
+      //*(retval->data+offset+2*sizeof(int))=sync.classID;
       // increase data pointer
       offset+=tempsize+3*sizeof(int);
@@ -200,4 +203,5 @@
     r->size = dest_length;
     r->diffed = true;
+    r->base_id = a->id;
     r->data = dp;
     return r;
@@ -232,4 +236,5 @@
     compressedGamestate->data = dest;
     compressedGamestate->diffed = a->diffed;
+    compressedGamestate->base_id = a->base_id;
 
     return compressedGamestate;
Index: /code/branches/network/src/network/PacketDecoder.cc
===================================================================
--- /code/branches/network/src/network/PacketDecoder.cc	(revision 985)
+++ /code/branches/network/src/network/PacketDecoder.cc	(revision 986)
@@ -165,8 +165,9 @@
     //size of uncompressed data
     memcpy( (void*)&(currentState->normsize), (const void*)(packet->data+3*sizeof( int )), sizeof( int ) );
+    memcpy( (void*)&(currentState->base_id), (const void*)(packet->data+4*sizeof( int )), sizeof( int ) );
     //currentState->normsize = (int)*(data+3*sizeof(int));
 //     std::cout << "normsize. " << currentState->normsize << std::endl;
     //since the packetgenerator was changed, due to a new parameter, change this function too
-    memcpy( (void*)&(currentState->diffed), (const void*)(packet->data+4*sizeof(int)), sizeof(bool));
+    memcpy( (void*)&(currentState->diffed), (const void*)(packet->data+5*sizeof(int)), sizeof(bool));
     //currentState->diffed = (bool)*(data+4*sizeof(int));
 //     std::cout << "diffed: " << currentState->diffed << std::endl;
Index: /code/branches/network/src/network/PacketGenerator.cc
===================================================================
--- /code/branches/network/src/network/PacketGenerator.cc	(revision 985)
+++ /code/branches/network/src/network/PacketGenerator.cc	(revision 986)
@@ -113,15 +113,8 @@
     memcpy( (void*)(data+2*sizeof(int)), (const void*)&(states->compsize), sizeof(int));
     memcpy( (void*)(data+3*sizeof(int)), (const void*)&(states->normsize), sizeof(int));
-    memcpy( (void*)(data+4*sizeof(int)), (const void*)&(states->diffed), sizeof(bool));
-    /*(int)*(data) = gid;
-    (int)*(data+sizeof(int)) = states->id;
-    //this is the compressed size of the GameStateCompressed data, place at 3th position of the enet datastream
-    (int)*(data+2*sizeof(int)) = states->compsize;
-    //this is the uncompressed size of GameStateCompressed data
-    (int)*(data+3*sizeof(int)) = states->normsize;
-    //since there is a new parameter inside GameStateCompressed, change this function to create packet
-    (bool)*(data+4*sizeof(int)) = states->diffed;*/
+    memcpy( (void*)(data+4*sizeof(int)), (const void*)&(states->base_id), sizeof(int));
+    memcpy( (void*)(data+5*sizeof(int)), (const void*)&(states->diffed), sizeof(bool));
     //place the GameStateCompressed data at the end of the enet datastream
-    memcpy( (void*)(data+4*sizeof( int ) + sizeof(bool)), (const void*)states->data, states->compsize );
+    memcpy( (void*)(data+5*sizeof( int ) + sizeof(bool)), (const void*)states->data, states->compsize );
     //create an enet packet with the generated bytestream
     ENetPacket *packet = enet_packet_create( data , totalLen, reliable );
Index: /code/branches/network/src/network/PacketTypes.h
===================================================================
--- /code/branches/network/src/network/PacketTypes.h	(revision 985)
+++ /code/branches/network/src/network/PacketTypes.h	(revision 986)
@@ -37,4 +37,5 @@
     int size;                       //!< total size of data
     // new ---- change functions
+    int base_id;                  // if gamestate is diffed this is the id of the old gamestate (base)
     bool diffed;
     unsigned char *data;            //!< pointer to data
@@ -52,4 +53,5 @@
     int normsize;                   //!< size of uncompressed data
     // new ----- change functions
+    int base_id;                  // if gamestate is diffed this is the id of the old gamestate (base)
     bool diffed;
     unsigned char *data;            //!< gamestate data
