Index: client/Client/main.cpp
===================================================================
--- client/Client/main.cpp	(revision 1ee0ffaf12a04b207cf18fc8c92520de754ad7d2)
+++ client/Client/main.cpp	(revision 5c7f28d940139b4cc01da65a2b0faa7edb455dba)
@@ -57,6 +57,5 @@
 void initWinSock();
 void shutdownWinSock();
-void processMessage(NETWORK_MSG &msg, int &state, chat &chatConsole, map<unsigned int, Player*>& mapPlayers,
-                    map<unsigned int, Projectile>& mapProjectiles, unsigned int& curPlayerId);
+void processMessage(NETWORK_MSG &msg, int &state, chat &chatConsole, map<unsigned int, Player*>& mapPlayers, unsigned int& curPlayerId);
 int getRefreshRate(int width, int height);
 void drawMessageStatus(ALLEGRO_FONT* font);
@@ -136,5 +135,4 @@
    bool key[4] = { false, false, false, false };
    map<unsigned int, Player*> mapPlayers;
-   map<unsigned int, Projectile> mapProjectiles;
    unsigned int curPlayerId = -1;
    ofstream outputLog;
@@ -371,10 +369,6 @@
             case ALLEGRO_KEY_D:  // drop the current item
                if (state == STATE_GAME) {
-                  Player* p = NULL;
                   try {
-                     p = mapPlayers.at(curPlayerId);
-                  } catch (const out_of_range& ex) {}
-
-                  if (p != NULL) {
+                     Player* p = mapPlayers.at(curPlayerId);
                      int flagType = OBJECT_NONE;
 
@@ -389,5 +383,5 @@
                         msgProcessor.sendMessage(&msgTo, &server);
                      }
-                  }
+                  } catch (const out_of_range& ex) {}
                }
                break;
@@ -428,6 +422,4 @@
                for(it = playersInGame.begin(); it != playersInGame.end(); it++)
                {
-                  // need to check if the right-click was actually on this player
-                  // right now, this code will target all players other than the current one
                   target = it->second;
                   cout << "set target" << endl;
@@ -459,5 +451,5 @@
 
       if (msgProcessor.receiveMessage(&msgFrom, &from) >= 0)
-         processMessage(msgFrom, state, chatConsole, mapPlayers, mapProjectiles, curPlayerId);
+         processMessage(msgFrom, state, chatConsole, mapPlayers, curPlayerId);
 
       if (redraw)
@@ -631,6 +623,5 @@
 }
 
-void processMessage(NETWORK_MSG &msg, int &state, chat &chatConsole, map<unsigned int, Player*>& mapPlayers,
-                    map<unsigned int, Projectile>& mapProjectiles, unsigned int& curPlayerId)
+void processMessage(NETWORK_MSG &msg, int &state, chat &chatConsole, map<unsigned int, Player*>& mapPlayers, unsigned int& curPlayerId)
 {
    // this is outdated since most messages now don't contain just a text string
@@ -790,38 +781,4 @@
                break;
             }
-            case MSG_TYPE_PROJECTILE:
-            {
-               cout << "Received a PROJECTILE message" << endl;
-
-               unsigned int id, x, y, targetId;
-
-               memcpy(&id, msg.buffer, 4);
-               memcpy(&x, msg.buffer+4, 4);
-               memcpy(&y, msg.buffer+8, 4);
-               memcpy(&targetId, msg.buffer+12, 4);
-
-               cout << "id: " << id << endl;
-               cout << "x: " << x << endl;
-               cout << "y: " << y << endl;
-               cout << "Target: " << targetId << endl;
-
-               Projectile proj(x, y, targetId, 0);
-               proj.setId(id);
-
-               mapProjectiles[id] = proj;
-
-               break;
-            }
-            case MSG_TYPE_REMOVE_PROJECTILE:
-            {
-                cout << "Received a REMOVE_PROJECTILE message" << endl;
-
-               int id;
-               memcpy(&id, msg.buffer, 4);
-               
-               mapProjectiles.erase(id);
-
-               break;
-            }
             case MSG_TYPE_GAME_INFO:
             {
@@ -971,4 +928,21 @@
                else
                   mapPlayers[p.getId()] = new Player(p);
+
+               break;
+            }
+             case MSG_TYPE_LOGOUT:
+            {
+               cout << "Got a logout message" << endl;
+
+               int playerId;
+
+               // Check if it's about you or another player
+               memcpy(&playerId, msg.buffer, 4);
+               response = string(msg.buffer+4);
+
+               if (playerId == curPlayerId)
+                  cout << "Received MSG_TYPE_LOGOUT for self in STATE_GAME. This shouldn't happen." << endl;
+               else
+                  delete mapPlayers[playerId];
 
                break;
