summaryrefslogtreecommitdiffstats
path: root/src/object/robotmain.cpp
diff options
context:
space:
mode:
authorerihel <erihel@gmail.com>2013-04-26 15:34:02 +0200
committererihel <erihel@gmail.com>2013-04-26 15:34:02 +0200
commit1828e60c92aad4a285fb6949bef5a33c113506e1 (patch)
tree9220dd76cb1e80948dc20a640e4f8663e3f0fb5b /src/object/robotmain.cpp
parent88478990b97c9c8d86a5a5edb8e293863266b640 (diff)
downloadcolobot-1828e60c92aad4a285fb6949bef5a33c113506e1.tar.gz
colobot-1828e60c92aad4a285fb6949bef5a33c113506e1.tar.bz2
colobot-1828e60c92aad4a285fb6949bef5a33c113506e1.zip
* Changed order of reading Audio and AudioChange (issue #173)
Diffstat (limited to 'src/object/robotmain.cpp')
-rw-r--r--src/object/robotmain.cpp37
1 files changed, 18 insertions, 19 deletions
diff --git a/src/object/robotmain.cpp b/src/object/robotmain.cpp
index 2729e91..f2ec838 100644
--- a/src/object/robotmain.cpp
+++ b/src/object/robotmain.cpp
@@ -3980,25 +3980,7 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
{
m_displayText->SetDelay(OpFloat(line, "factor", 1.0f));
}
-
- if (Cmd(line, "Audio") && !resetObject)
- {
- if(m_version < 2) {
- int trackid = OpInt(line, "track", 0);
- if(trackid != 0) {
- std::stringstream filename;
- filename << "music" << std::setfill('0') << std::setw(3) << trackid << ".ogg";
- m_audioTrack = filename.str();
- }
- } else {
- char trackname[100];
- OpString(line, "filename", trackname);
- m_audioTrack = trackname;
- }
- m_audioRepeat = OpInt(line, "repeat", 1);
- if(m_audioTrack != "") m_sound->CacheMusic(m_audioTrack);
- }
-
+
if (Cmd(line, "AudioChange") && !resetObject && m_version >= 2)
{
int i = m_audioChangeTotal;
@@ -4019,6 +4001,23 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
}
}
+ if (Cmd(line, "Audio") && !resetObject)
+ {
+ if(m_version < 2) {
+ int trackid = OpInt(line, "track", 0);
+ if(trackid != 0) {
+ std::stringstream filename;
+ filename << "music" << std::setfill('0') << std::setw(3) << trackid << ".ogg";
+ m_audioTrack = filename.str();
+ }
+ } else {
+ char trackname[100];
+ OpString(line, "filename", trackname);
+ m_audioTrack = trackname;
+ }
+ m_audioRepeat = OpInt(line, "repeat", 1);
+ if(m_audioTrack != "") m_sound->CacheMusic(m_audioTrack);
+ }
if (Cmd(line, "AmbientColor") && !resetObject)
{