Changeset 10174 for code/branches/storymodeHS14/src/orxonox
- Timestamp:
- Dec 11, 2014, 3:51:27 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/storymodeHS14/src/orxonox/gametypes/Mission.cc
r10157 r10174 82 82 { 83 83 std::fstream myfile; 84 myfile.open("/home/pmao/pmao-extra-0/orxonox/storymodeHS14/data/gui/scripts/campaign.txt"); 85 std::string line; 86 std::string mission=this->getFilename(); 87 int k=58-mission.length(); 88 std::string helperstring = ""; 89 if(myfile.is_open()){ 90 while (k>1) { 91 helperstring=helperstring+" "; 92 k=k-1; 93 } 94 helperstring=helperstring+"."; 95 while(getline (myfile,line)){ 96 if(line==mission+" 0"+helperstring){ 97 long pos = myfile.tellp(); 98 myfile.seekp (pos-61); 99 myfile << mission+" 1"+helperstring; 100 } 101 }} 102 else{ 103 this->end(); 104 } 105 myfile.flush(); 106 myfile.clear(); 107 myfile.close(); 84 108 85 Gametype::start(); 109 86 this->setTeams(); 110 87 //just for testing 88 //this->missionAccomplished_=true; 111 89 this->gtinfo_->sendAnnounceMessage("Your mission has started!"); 112 90 } … … 128 106 this->gtinfo_->sendAnnounceMessage("Mission accomplished!"); 129 107 std::fstream myfile; 130 myfile.open("/home/ pmao/pmao-extra-0/orxonox/storymodeHS14/data/gui/scripts/campaign.txt");108 myfile.open("/home/maxima/maxima-extra-0/orxonox/storymodeHS14/campaign.txt"); 131 109 std::string line; 132 110 std::string mission=this->getFilename(); … … 169 147 for (ObjectList<Mission>::iterator it = ObjectList<Mission>::begin(); it != ObjectList<Mission>::end(); ++it) 170 148 {//TODO: make sure that only the desired mission is ended !! This is a dirty HACK, that would end ALL missions! 171 if(accomplished){149 /* if(accomplished){ 172 150 std::fstream myfile; 173 151 myfile.open("/home/pmao/pmao-extra-0/orxonox/storymodeHS14/data/gui/scripts/campaign.txt"); … … 193 171 myfile.clear(); 194 172 myfile.close(); 195 } 173 }*/ 196 174 it->setMissionAccomplished(accomplished); 197 175 it->end();
Note: See TracChangeset
for help on using the changeset viewer.