Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 1, 2015, 11:46:42 PM (10 years ago)
Author:
landauf
Message:

use relative path

File:
1 edited

Legend:

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

    r10249 r10251  
    2828
    2929#include "Mission.h"
     30
     31#include <boost/filesystem.hpp>
     32
    3033#include "items/Engine.h"
    3134#include "controllers/ArtificialController.h"
     
    108111        {
    109112            this->gtinfo_->sendAnnounceMessage("Mission accomplished!");
     113
     114            boost::filesystem::path filepath("campaign.txt");
    110115            std::fstream myfile;
    111             myfile.open("/home/maxima/maxima-extra-0/orxonox/storymodeHS14/campaign.txt");
     116            myfile.open(filepath.string().c_str(), std::fstream::out);
     117
    112118            std::string line;
    113119            std::string mission = this->getFilename();
     
    126132                    if (line == mission + " 0" + helperstring)
    127133                    {
    128                         long pos = myfile.tellp();
     134                        long pos = (long) myfile.tellp();
    129135                        myfile.seekp(pos - 61);
    130136                        myfile << mission + " 1" + helperstring;
    131137                    }
    132138                }
     139            } else {
     140                orxout(internal_warning) << "failed to open campaign file" << endl;
    133141            }
    134142            myfile.flush();
Note: See TracChangeset for help on using the changeset viewer.