Changeset 11071 for code/trunk/src/orxonox/gametypes/UnderAttack.cc
- Timestamp:
- Jan 17, 2016, 10:29:21 PM (8 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/gametypes/UnderAttack.cc
r9941 r11071 48 48 this->gameTime_ = 180; 49 49 this->teams_ = 2; 50 this->destroyer_ = 0;50 this->destroyer_ = nullptr; 51 51 this->destroyer_.setCallback(createFunctor(&UnderAttack::killedDestroyer, this)); 52 52 this->gameEnded_ = false; … … 74 74 this->gameEnded_ = true; 75 75 76 for ( std::map<PlayerInfo*, int>::iterator it = this->teamnumbers_.begin(); it != this->teamnumbers_.end(); ++it)77 { 78 if ( it->first->getClientID() == NETWORK_PEER_ID_UNKNOWN)76 for (const auto& mapEntry : this->teamnumbers_) 77 { 78 if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN) 79 79 continue; 80 80 81 if ( it->second == attacker_)82 this->gtinfo_->sendAnnounceMessage("You have won the match!", it->first->getClientID());81 if (mapEntry.second == attacker_) 82 this->gtinfo_->sendAnnounceMessage("You have won the match!", mapEntry.first->getClientID()); 83 83 else 84 this->gtinfo_->sendAnnounceMessage("You have lost the match!", it->first->getClientID());84 this->gtinfo_->sendAnnounceMessage("You have lost the match!", mapEntry.first->getClientID()); 85 85 } 86 86 } … … 155 155 ChatManager::message(message); 156 156 157 for ( std::map<PlayerInfo*, int>::iterator it = this->teamnumbers_.begin(); it != this->teamnumbers_.end(); ++it)158 { 159 if ( it->first->getClientID() == NETWORK_PEER_ID_UNKNOWN)157 for (const auto& mapEntry : this->teamnumbers_) 158 { 159 if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN) 160 160 continue; 161 161 162 if ( it->second == 1)163 this->gtinfo_->sendAnnounceMessage("You have won the match!", it->first->getClientID());162 if (mapEntry.second == 1) 163 this->gtinfo_->sendAnnounceMessage("You have won the match!", mapEntry.first->getClientID()); 164 164 else 165 this->gtinfo_->sendAnnounceMessage("You have lost the match!", it->first->getClientID());165 this->gtinfo_->sendAnnounceMessage("You have lost the match!", mapEntry.first->getClientID()); 166 166 } 167 167 } … … 202 202 void UnderAttack::setTransporterHealth() 203 203 { 204 if (this->destroyer_ != 0)204 if (this->destroyer_ != nullptr) 205 205 { 206 206 //Calculation: Each attacker deals about 3500 damage. A human attacker deals 1500 damage additionally.
Note: See TracChangeset
for help on using the changeset viewer.