Index: common/Game.cpp
===================================================================
--- common/Game.cpp	(revision 402cf86857bd74889d5f5ddc68a7ee9ebd44c16a)
+++ common/Game.cpp	(revision 686589c2951fb71214aa953619d578c10380e566)
@@ -1,3 +1,5 @@
 #include "Game.h"
+
+#include "Common.h"
 
 using namespace std;
@@ -112,4 +114,37 @@
 }
 
+// returns the id of the picked-up flag or -1 if none was picked up
+int Game::processFlagPickupRequest(Player* p) {
+   vector<WorldMap::Object>* vctObjects = this->worldMap->getObjects();
+   vector<WorldMap::Object>::iterator it;
+   int playerId = -1;
+
+   for (it = vctObjects->begin(); it != vctObjects->end(); it++) {
+      if (posDistance(p->pos, it->pos.toFloat()) < 10) {
+         switch (it->type) {
+            case WorldMap::OBJECT_BLUE_FLAG:
+               if (p->team == 1) {
+                  p->hasBlueFlag = true;
+                  playerId = it->id;
+               }
+               break;
+            case WorldMap::OBJECT_RED_FLAG:
+               if (p->team == 0) {
+                  p->hasRedFlag = true;
+                  playerId = it->id;
+               }
+               break;
+         }
+
+         if (playerId > -1) {
+            vctObjects->erase(it);
+            return playerId;
+         }
+      }
+   }
+
+   return playerId;
+}
+
 void Game::setRedScore(int score) {
    this->redScore = score;
Index: common/Game.h
===================================================================
--- common/Game.h	(revision 402cf86857bd74889d5f5ddc68a7ee9ebd44c16a)
+++ common/Game.h	(revision 686589c2951fb71214aa953619d578c10380e566)
@@ -43,4 +43,5 @@
    bool startPlayerMovement(unsigned int id, int x, int y);
    bool processPlayerMovement(Player* p, FLOAT_POSITION oldPos);
+   int processFlagPickupRequest(Player* p);
 
    void setBlueScore(int score);
