[Orxonox-commit 5588] r10251 - in code/branches/storymodeHS14: data/gui/scripts data/tcl src/orxonox/gametypes

landauf at orxonox.net landauf at orxonox.net
Sun Feb 1 23:46:42 CET 2015


Author: landauf
Date: 2015-02-01 23:46:42 +0100 (Sun, 01 Feb 2015)
New Revision: 10251

Modified:
   code/branches/storymodeHS14/data/gui/scripts/CampaignMenu.lua
   code/branches/storymodeHS14/data/tcl/
   code/branches/storymodeHS14/src/orxonox/gametypes/Mission.cc
Log:
use relative path

Modified: code/branches/storymodeHS14/data/gui/scripts/CampaignMenu.lua
===================================================================
--- code/branches/storymodeHS14/data/gui/scripts/CampaignMenu.lua	2015-02-01 21:51:47 UTC (rev 10250)
+++ code/branches/storymodeHS14/data/gui/scripts/CampaignMenu.lua	2015-02-01 22:46:42 UTC (rev 10251)
@@ -51,7 +51,7 @@
 end
     
 function P.CheckLevel(filename)
-    local file = io.open("/home/pmao/pmao-extra-0/orxonox/storymode/campaign.txt", "r+")
+    local file = io.open("campaign.txt", "r+")
     local index = 0
     local returnvalue = false
     local numberoflines = 58-string.len(filename)


Property changes on: code/branches/storymodeHS14/data/tcl
___________________________________________________________________
Added: svn:ignore
   + campaign.txt


Modified: code/branches/storymodeHS14/src/orxonox/gametypes/Mission.cc
===================================================================
--- code/branches/storymodeHS14/src/orxonox/gametypes/Mission.cc	2015-02-01 21:51:47 UTC (rev 10250)
+++ code/branches/storymodeHS14/src/orxonox/gametypes/Mission.cc	2015-02-01 22:46:42 UTC (rev 10251)
@@ -27,6 +27,9 @@
  */
 
 #include "Mission.h"
+
+#include <boost/filesystem.hpp>
+
 #include "items/Engine.h"
 #include "controllers/ArtificialController.h"
 
@@ -107,8 +110,11 @@
         if (this->missionAccomplished_ && !this->gtinfo_->hasEnded())
         {
             this->gtinfo_->sendAnnounceMessage("Mission accomplished!");
+
+            boost::filesystem::path filepath("campaign.txt");
             std::fstream myfile;
-            myfile.open("/home/maxima/maxima-extra-0/orxonox/storymodeHS14/campaign.txt");
+            myfile.open(filepath.string().c_str(), std::fstream::out);
+
             std::string line;
             std::string mission = this->getFilename();
             int k = 58 - mission.length();
@@ -125,11 +131,13 @@
                 {
                     if (line == mission + " 0" + helperstring)
                     {
-                        long pos = myfile.tellp();
+                        long pos = (long) myfile.tellp();
                         myfile.seekp(pos - 61);
                         myfile << mission + " 1" + helperstring;
                     }
                 }
+            } else {
+                orxout(internal_warning) << "failed to open campaign file" << endl;
             }
             myfile.flush();
             myfile.clear();




More information about the Orxonox-commit mailing list