Changes in common/Player.cpp [7c52498:88c0536] in network-game


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • common/Player.cpp

    r7c52498 r88c0536  
    144144   memcpy(buffer+46, &this->range, 4);
    145145
    146    strcpy(buffer+46, this->name.c_str());
     146   strcpy(buffer+50, this->name.c_str());
    147147}
    148148
     
    165165   memcpy(&this->range, buffer+46, 4);
    166166
    167    this->name.assign(buffer+46);
     167   this->name.assign(buffer+50);
    168168}
    169169
     
    199199      this->target.y = mapPlayers[this->targetPlayer].pos.y;
    200200
     201      cout << "Setting target" << endl;
     202      cout << "target id: " << mapPlayers[this->targetPlayer].id << endl;
     203      cout << "cur player id: " << this->id << endl;
     204      cout << "this->pos.x: " << this->pos.x << endl;
     205      cout << "this->pos.x: " << this->pos.x << endl;
     206      cout << "this->target.y: " << this->target.y << endl;
     207      cout << "this->target.y: " << this->target.y << endl;
     208      cout << "this->target.toFloat().x: " << this->target.toFloat().y << endl;
     209      cout << "this->target.toFloat().y: " << this->target.toFloat().y << endl;
     210      cout << "posDistance: " << posDistance(this->pos, this->target.toFloat()) << endl;
     211
    201212      if (posDistance(this->pos, this->target.toFloat()) <= this->range) {
     213         cout << "Stopped chasing" << endl;
     214
    202215         this->target.x = this->pos.x;
    203216         this->target.y = this->pos.y;
Note: See TracChangeset for help on using the changeset viewer.