Changeset 5b1e31e in network-game for common/Player.cpp
- Timestamp:
- Jun 16, 2013, 11:12:31 PM (12 years ago)
- Branches:
- master
- Children:
- 032e550, d3e8f60
- Parents:
- ff2133a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
common/Player.cpp
rff2133a r5b1e31e 142 142 memcpy(buffer+44, &this->hasBlueFlag, 1); 143 143 memcpy(buffer+45, &this->hasRedFlag, 1); 144 memcpy(buffer+46, &this->range, 4); 144 145 145 146 strcpy(buffer+46, this->name.c_str()); … … 162 163 memcpy(&this->hasBlueFlag, buffer+44, 1); 163 164 memcpy(&this->hasRedFlag, buffer+45, 1); 165 memcpy(&this->range, buffer+46, 4); 164 166 165 167 this->name.assign(buffer+46); … … 192 194 } 193 195 194 voidPlayer::updateTarget(map<unsigned int, Player>& mapPlayers) {196 bool Player::updateTarget(map<unsigned int, Player>& mapPlayers) { 195 197 if (this->isChasing) { 196 198 this->target.x = mapPlayers[this->targetPlayer].pos.x; … … 204 206 this->isAttacking = true; 205 207 this->timeAttackStarted = getCurrentMillis(); 208 209 return true; 206 210 } 207 211 } 208 } 212 213 return false; 214 }
Note:
See TracChangeset
for help on using the changeset viewer.