Changeset 10258 for code/trunk/src/orxonox/gametypes
- Timestamp:
- Feb 5, 2015, 11:47:13 PM (9 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/gametypes/Mission.cc
r9986 r10258 28 28 29 29 #include "Mission.h" 30 30 31 #include "items/Engine.h" 31 32 #include "controllers/ArtificialController.h" … … 36 37 #include "network/Host.h" 37 38 #include "worldentities/pawns/Pawn.h" 38 39 #include "LevelManager.h" 39 40 40 41 namespace orxonox … … 70 71 void Mission::pawnKilled(Pawn* victim, Pawn* killer) 71 72 { 72 if (victim && victim->getPlayer() && victim->getPlayer()->isHumanPlayer() 73 if (victim && victim->getPlayer() && victim->getPlayer()->isHumanPlayer()) 73 74 { 74 75 this->lives_--; … … 87 88 { 88 89 if (this->missionAccomplished_ && !this->gtinfo_->hasEnded()) 90 { 89 91 this->gtinfo_->sendAnnounceMessage("Mission accomplished!"); 92 93 LevelManager::getInstance().setLastFinishedCampaignMission(this->getFilename()); 94 } 90 95 else if (!this->gtinfo_->hasEnded()) 91 96 this->gtinfo_->sendAnnounceMessage("Mission failed!"); 97 92 98 Gametype::end(); 93 99 } 94 100 95 101 void Mission::setTeams() 96 { //Set pawn-colours102 { //Set pawn-colours 97 103 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it) 98 104 { 99 105 Pawn* pawn = static_cast<Pawn*>(*it); 100 if(!pawn) continue; 101 this->setDefaultObjectColour(pawn); 106 if (!pawn) 107 continue; 108 this->setDefaultObjectColour(pawn); 102 109 } 103 110 } … … 105 112 { 106 113 for (ObjectList<Mission>::iterator it = ObjectList<Mission>::begin(); it != ObjectList<Mission>::end(); ++it) 107 { //TODO: make sure that only the desired mission is ended !! This is a dirty HACK, that would end ALL missions!114 { //TODO: make sure that only the desired mission is ended !! This is a dirty HACK, that would end ALL missions! 108 115 it->setMissionAccomplished(accomplished); 109 116 it->end(); 110 117 } 111 118 } 112 119 113 120 void Mission::setLivesWrapper(unsigned int amount) 114 121 { 115 122 for (ObjectList<Mission>::iterator it = ObjectList<Mission>::begin(); it != ObjectList<Mission>::end(); ++it) 116 { //TODO: make sure that only the desired mission is ended !! This is a dirty HACK, that would affect ALL missions!123 { //TODO: make sure that only the desired mission is ended !! This is a dirty HACK, that would affect ALL missions! 117 124 it->setLives(amount); 118 125 } 119 126 } 120 121 122 127 }
Note: See TracChangeset
for help on using the changeset viewer.