Changeset 5929 for code/trunk/src/orxonox/gametypes/UnderAttack.cc
- Timestamp:
- Oct 12, 2009, 8:20:07 PM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/core5 (added) merged: 5768-5769,5772,5775-5780,5783-5785,5791-5792,5795-5807,5809-5814,5816-5832,5836-5839,5842-5853,5855-5899,5904-5922,5924-5928
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/gametypes/UnderAttack.cc
r5781 r5929 46 46 this->teams_ = 2; 47 47 this->destroyer_ = 0; 48 this->destroyer_.setCallback(createFunctor(&UnderAttack::killedDestroyer, this)); 48 49 this->gameEnded_ = false; 49 50 … … 65 66 66 67 67 void UnderAttack:: destroyedPawn(Pawn* pawn)68 void UnderAttack::killedDestroyer() 68 69 { 69 if (pawn == this->destroyer_) 70 this->end(); //end gametype 71 std::string message = "Ship destroyed! Team 0 has won!"; 72 COUT(0) << message << std::endl; 73 Host::Broadcast(message); 74 this->gameEnded_ = true; 75 76 for (std::map<PlayerInfo*, int>::iterator it = this->teamnumbers_.begin(); it != this->teamnumbers_.end(); ++it) 70 77 { 71 this->end(); //end gametype 72 std::string message = "Ship destroyed! Team 0 has won!"; 73 COUT(0) << message << std::endl; 74 Host::Broadcast(message); 75 this->gameEnded_ = true; 78 if (it->first->getClientID() == CLIENTID_UNKNOWN) 79 continue; 76 80 77 for (std::map<PlayerInfo*, int>::iterator it = this->teamnumbers_.begin(); it != this->teamnumbers_.end(); ++it) 78 { 79 if (it->first->getClientID() == CLIENTID_UNKNOWN) 80 continue; 81 82 if (it->second == 0) 83 this->gtinfo_.sendAnnounceMessage("You have won the match!", it->first->getClientID()); 84 else 85 this->gtinfo_.sendAnnounceMessage("You have lost the match!", it->first->getClientID()); 86 } 81 if (it->second == 0) 82 this->gtinfo_->sendAnnounceMessage("You have won the match!", it->first->getClientID()); 83 else 84 this->gtinfo_->sendAnnounceMessage("You have lost the match!", it->first->getClientID()); 87 85 } 88 86 } … … 164 162 165 163 if (it->second == 1) 166 this->gtinfo_ .sendAnnounceMessage("You have won the match!", it->first->getClientID());164 this->gtinfo_->sendAnnounceMessage("You have won the match!", it->first->getClientID()); 167 165 else 168 this->gtinfo_ .sendAnnounceMessage("You have lost the match!", it->first->getClientID());166 this->gtinfo_->sendAnnounceMessage("You have lost the match!", it->first->getClientID()); 169 167 } 170 168 } … … 178 176 Host::Broadcast(message); 179 177 */ 180 this->gtinfo_ .sendAnnounceMessage(message);178 this->gtinfo_->sendAnnounceMessage(message); 181 179 182 180 if (timesequence_ >= 30 && timesequence_ <= 60)
Note: See TracChangeset
for help on using the changeset viewer.