[colobot] 76/390: Added %chap% for current chapter directory

Didier Raboud odyx at moszumanska.debian.org
Fri Jun 12 14:21:30 UTC 2015


This is an automated email from the git hooks/post-receive script.

odyx pushed a commit to branch upstream/latest
in repository colobot.

commit 3ef2f976df56817d2a23d4fe88a1917798beaacd
Author: krzys-h <krzys_h at interia.pl>
Date:   Mon Sep 29 21:53:21 2014 +0200

    Added %chap% for current chapter directory
---
 src/object/level/parser.cpp      | 2 +-
 src/object/level/parserparam.cpp | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/object/level/parser.cpp b/src/object/level/parser.cpp
index 383931c..2bd43a3 100644
--- a/src/object/level/parser.cpp
+++ b/src/object/level/parser.cpp
@@ -63,7 +63,7 @@ std::string CLevelParser::BuildSceneName(std::string category, int chapter, int
     if(category == "custom")
     {
         outstream << "levels/custom/";
-        outstream << CRobotMain::GetInstancePointer()->GetUserLevelName(chapter) << "/";
+        outstream << CRobotMain::GetInstancePointer()->GetUserLevelName(chapter);
         if(rank == 000)
         {
             if(sceneFile)
diff --git a/src/object/level/parserparam.cpp b/src/object/level/parserparam.cpp
index 50152c5..4dc5742 100644
--- a/src/object/level/parserparam.cpp
+++ b/src/object/level/parserparam.cpp
@@ -165,6 +165,8 @@ std::string CLevelParserParam::InjectLevelDir(std::string path, const std::strin
     std::string newPath = path;
     std::string lvlDir = CLevelParser::BuildSceneName(CRobotMain::GetInstancePointer()->GetSceneName(), CRobotMain::GetInstancePointer()->GetSceneRank()/100, CRobotMain::GetInstancePointer()->GetSceneRank()%100, false);
     boost::replace_all(newPath, "%lvl%", lvlDir);
+    std::string chapDir = CLevelParser::BuildSceneName(CRobotMain::GetInstancePointer()->GetSceneName(), CRobotMain::GetInstancePointer()->GetSceneRank()/100, 0, false);
+    boost::replace_all(newPath, "%chap%", chapDir);
     if(newPath == path)
     {
         newPath = defaultDir + (!defaultDir.empty() ? "/" : "") + newPath;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/colobot.git



More information about the Pkg-games-commits mailing list