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


Ignore:
Timestamp:
Oct 1, 2013, 8:08:24 PM (12 years ago)
Author:
Dmitry Portnoy <dportnoy@…>
Branches:
master
Children:
95ffe57
Parents:
373089e
Message:

The client dynamically allocates memory for players and passes around a map with player pointers and some includes are now in individual files instead of in Common.h

File:
1 edited

Legend:

Unmodified
Added
Removed
  • common/Player.cpp

    r373089e re6c26b8  
    206206}
    207207
    208 bool Player::updateTarget(map<unsigned int, Player>& mapPlayers) {
     208bool Player::updateTarget(map<unsigned int, Player*>& mapPlayers) {
    209209   if (this->isChasing) {
    210       this->target.x = mapPlayers[this->targetPlayer].pos.x;
    211       this->target.y = mapPlayers[this->targetPlayer].pos.y;
     210      this->target.x = mapPlayers[this->targetPlayer]->pos.x;
     211      this->target.y = mapPlayers[this->targetPlayer]->pos.y;
    212212
    213213      if (posDistance(this->pos, this->target.toFloat()) <= this->range) {
Note: See TracChangeset for help on using the changeset viewer.