Index: client/Client/GameRender.cpp
===================================================================
--- client/Client/GameRender.cpp	(revision 1ee0ffaf12a04b207cf18fc8c92520de754ad7d2)
+++ client/Client/GameRender.cpp	(revision 5c7f28d940139b4cc01da65a2b0faa7edb455dba)
@@ -16,20 +16,32 @@
       for (int y=0; y<gameMap->height; y++)
       {
-         TerrainType el = gameMap->getElement(x, y);
+         TerrainType terrain = gameMap->getElement(x, y);
          StructureType structure = gameMap->getStructure(x, y);
 
-         if (el == TERRAIN_GRASS)
+         switch(terrain) {
+         case TERRAIN_GRASS:
             al_draw_filled_rectangle(x*25+mapPos.x, y*25+mapPos.y, x*25+25+mapPos.x, y*25+25+mapPos.y, al_map_rgb(0, 255, 0));
-         else if (el == TERRAIN_OCEAN)
+            break;
+         case TERRAIN_OCEAN:
             al_draw_filled_rectangle(x*25+mapPos.x, y*25+mapPos.y, x*25+25+mapPos.x, y*25+25+mapPos.y, al_map_rgb(0, 0, 255));
-         else if (el == TERRAIN_ROCK)
+            break;
+         case TERRAIN_ROCK:
             al_draw_filled_rectangle(x*25+mapPos.x, y*25+mapPos.y, x*25+25+mapPos.x, y*25+25+mapPos.y, al_map_rgb(100, 100, 0));
+            break;
+         case TERRAIN_NONE:
+            break;
+         }  
 
-         if (structure == STRUCTURE_BLUE_FLAG) {
+         switch(structure) {
+         case STRUCTURE_BLUE_FLAG:
             al_draw_circle(x*25+12+mapPos.x, y*25+12+mapPos.y, 12, al_map_rgb(0, 0, 0), 3);
             //al_draw_filled_rectangle(x*25+5+mapPos.x, y*25+5+mapPos.y, x*25+20+mapPos.x, y*25+20+mapPos.y, al_map_rgb(0, 0, 255));
-         }else if (structure == STRUCTURE_RED_FLAG) {
+            break;
+         case STRUCTURE_RED_FLAG:
             al_draw_circle(x*25+12+mapPos.x, y*25+12+mapPos.y, 12, al_map_rgb(0, 0, 0), 3);
             //al_draw_filled_rectangle(x*25+5+mapPos.x, y*25+5+mapPos.y, x*25+20+mapPos.x, y*25+20+mapPos.y, al_map_rgb(255, 0, 0));
+            break;
+         case STRUCTURE_NONE:
+            break;
          }
       }
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;
