Changeset d998572 in network-game for common/Player.cpp


Ignore:
Timestamp:
Jan 19, 2014, 8:19:18 PM (11 years ago)
Author:
dportnoy <dmp1488@…>
Branches:
master
Children:
9ba9b96
Parents:
1f6233e
Message:

updateTarget (from the Player class) now takes the target as a parameter instead of the whole player map

File:
1 edited

Legend:

Unmodified
Added
Removed
  • common/Player.cpp

    r1f6233e rd998572  
    217217}
    218218
    219 bool Player::updateTarget(map<unsigned int, Player*>& mapPlayers) {
     219bool Player::updateTarget(const Player* targetPlayer) {
    220220   if (this->isChasing) {
    221       this->target.x = mapPlayers[this->targetPlayer]->pos.x;
    222       this->target.y = mapPlayers[this->targetPlayer]->pos.y;
     221      this->target.x = targetPlayer->pos.x;
     222      this->target.y = targetPlayer->pos.y;
    223223
    224224      if (posDistance(this->pos, this->target.toFloat()) <= this->range) {
Note: See TracChangeset for help on using the changeset viewer.