Index: client/Client/main.cpp
===================================================================
--- client/Client/main.cpp	(revision e487381875396bdaf64765cbdc022477e1238ac0)
+++ client/Client/main.cpp	(revision 7511a2b0ff95b2a94795fa2328bdea8e722bbc5c)
@@ -453,5 +453,5 @@
             case MSG_TYPE_PLAYER:   // kind of hacky to put this here
             {
-               cout << "Got MSG_TYPE_PLAYER message in Start" << endl;
+               cout << "Got MSG_TYPE_PLAYER message in STATE_START" << endl;
 
                Player p("", "");
@@ -467,8 +467,9 @@
             case MSG_TYPE_OBJECT:
             {
-               cout << "Received object message. Baller Biller!" << endl;
+               cout << "Received OBJECT message in STATE_START." << endl;
 
                WorldMap::Object o(0, WorldMap::OBJECT_NONE, 0, 0);
                o.deserialize(msg.buffer);
+               cout << "object id: " << o.id << endl;
                gameMap->updateObject(o.id, o.type, o.pos.x, o.pos.y);
 
@@ -511,5 +512,5 @@
             case MSG_TYPE_PLAYER:
             {
-               cout << "Got MSG_TYPE_PLAYER message in Login" << endl;
+               cout << "Got MSG_TYPE_PLAYER message in STATE_LOGIN" << endl;
 
                Player p("", "");
@@ -544,5 +545,5 @@
             case MSG_TYPE_OBJECT:
             {
-               cout << "Received object message. Baller Biller!" << endl;
+               cout << "Received object message in STATE_LOGIN." << endl;
 
                WorldMap::Object o(0, WorldMap::OBJECT_NONE, 0, 0);
@@ -554,8 +555,15 @@
             case MSG_TYPE_REMOVE_OBJECT:
             {
+               cout << "Received REMOVE_OBJECT message!" << endl;
+
                int id;
                memcpy(&id, msg.buffer, 4);
+
+               cout << "Removing object with id " << id << endl;
+
                if (!gameMap->removeObject(id))
                   cout << "Did not remove the object" << endl;
+
+               break;
             }
             default:
Index: common/WorldMap.cpp
===================================================================
--- common/WorldMap.cpp	(revision e487381875396bdaf64765cbdc022477e1238ac0)
+++ common/WorldMap.cpp	(revision 7511a2b0ff95b2a94795fa2328bdea8e722bbc5c)
@@ -68,9 +68,10 @@
    return vctObjects;
 }
+
 vector<WorldMap::Object> WorldMap::getObjects(int x, int y) {
    vector<WorldMap::Object> vctObjectsInRegion;
 
    vector<WorldMap::Object>::iterator it;
-   for(it = vctObjects->begin(); it != vctObjects->end(); it++) {
+   for (it = vctObjects->begin(); it != vctObjects->end(); it++) {
       if (it->pos.x/25 == x && it->pos.y/25 == y)
          vctObjectsInRegion.push_back(*it);
@@ -82,5 +83,18 @@
 // used by the server to create new objects
 void WorldMap::addObject(WorldMap::ObjectType t, int x, int y) {
-   WorldMap::Object o(vctObjects->size(), t, x, y);
+   int id;
+   vector<WorldMap::Object>::iterator it;
+
+   for (id = 0; id < vctObjects->size(); id++) {
+      for (it = vctObjects->begin(); it != vctObjects->end(); it++) {
+         if (id == it->id)
+            break;
+      }
+
+      if (it == vctObjects->end())  // if no objects with this id exists
+         break;
+   }
+
+   WorldMap::Object o(id, t, x, y);
    vctObjects->push_back(o);
 }
@@ -91,7 +105,26 @@
    bool foundObject = false;
 
+   cout << "Searching for obbject to update" << endl;
+   switch (t) {
+   case WorldMap::OBJECT_BLUE_FLAG:
+      cout << "BLUE_FLAG" << endl;
+      break;
+   case WorldMap::OBJECT_RED_FLAG:
+      cout << "RED_FLAG" << endl;
+      break;
+   }
+
    for (it = vctObjects->begin(); it != vctObjects->end(); it++) {
       if (it->id == id) {
          foundObject = true;
+         cout << "Found object with id " << id << endl;
+         switch (it->type) {
+         case WorldMap::OBJECT_BLUE_FLAG:
+            cout << "BLUE_FLAG" << endl;
+            break;
+         case WorldMap::OBJECT_RED_FLAG:
+            cout << "RED_FLAG" << endl;
+            break;
+         }
          it->pos.x = x;
          it->pos.y = y;
