Index: common/Player.cpp
===================================================================
--- common/Player.cpp	(revision 11d21ee11d4c61808a4280cdafbf7778a7af72c9)
+++ common/Player.cpp	(revision ff2133aee0f65c9b2661b1823a42193172c15167)
@@ -191,2 +191,18 @@
    return moving;
 }
+
+void Player::updateTarget(map<unsigned int, Player>& mapPlayers) {
+   if (this->isChasing) {
+      this->target.x = mapPlayers[this->targetPlayer].pos.x;
+      this->target.y = mapPlayers[this->targetPlayer].pos.y;
+
+      if (posDistance(this->pos, this->target.toFloat()) <= this->range) {
+         this->target.x = this->pos.x;
+         this->target.y = this->pos.y;
+
+         this->isChasing = false;
+         this->isAttacking = true;
+         this->timeAttackStarted = getCurrentMillis();
+      }
+   }
+}
Index: common/Player.h
===================================================================
--- common/Player.h	(revision 11d21ee11d4c61808a4280cdafbf7778a7af72c9)
+++ common/Player.h	(revision ff2133aee0f65c9b2661b1823a42193172c15167)
@@ -12,4 +12,5 @@
 
 #include <string>
+#include <map>
 
 #include "Common.h"
@@ -46,8 +47,9 @@
    void deserialize(char* buffer);
 
+   void updateTarget(map<unsigned int, Player>& mapPlayers);
    bool move(WorldMap *map);
 
-   void takeFlag(int flag, WorldMap *map);
-   void dropFlag(int flag, WorldMap *map);
+   void takeFlag(int flag, WorldMap* map);
+   void dropFlag(int flag, WorldMap* map);
 
    int id;
Index: common/Projectile.cpp
===================================================================
--- common/Projectile.cpp	(revision 11d21ee11d4c61808a4280cdafbf7778a7af72c9)
+++ common/Projectile.cpp	(revision ff2133aee0f65c9b2661b1823a42193172c15167)
@@ -72,4 +72,8 @@
 
 bool Projectile::move(map<unsigned int, Player>& mapPlayers) {
+   // if the current target logs off, this method will run into problems
+
+   //cout << "Inside projectile move" << endl;
+
    unsigned long long curTime = getCurrentMillis();
    Player targetP = mapPlayers[target];
@@ -85,4 +89,6 @@
    float dist = sqrt(pow(targetP.pos.x-pos.x, 2) + pow(targetP.pos.y-pos.y, 2));
 
+   //cout << "About to finish projectile move" << endl;
+
    if (dist <= pixels) {
       pos.x = targetP.pos.x;
