Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 11, 2014, 3:51:27 PM (9 years ago)
Author:
maxima
Message:

Final version for presentation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/storymodeHS14/src/orxonox/gametypes/Mission.cc

    r10157 r10174  
    8282    {
    8383        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
    10885        Gametype::start();
    10986        this->setTeams();
    110 
     87        //just for testing
     88        //this->missionAccomplished_=true;
    11189        this->gtinfo_->sendAnnounceMessage("Your mission has started!");
    11290    }
     
    128106            this->gtinfo_->sendAnnounceMessage("Mission accomplished!");
    129107            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");
    131109                                std::string line;
    132110                                std::string mission=this->getFilename();
     
    169147        for (ObjectList<Mission>::iterator it = ObjectList<Mission>::begin(); it != ObjectList<Mission>::end(); ++it)
    170148        {//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){
    172150                std::fstream myfile;
    173151                        myfile.open("/home/pmao/pmao-extra-0/orxonox/storymodeHS14/data/gui/scripts/campaign.txt");
     
    193171                    myfile.clear();
    194172                    myfile.close();
    195             }
     173            }*/
    196174                it->setMissionAccomplished(accomplished);
    197175            it->end();
Note: See TracChangeset for help on using the changeset viewer.