diff options
author | Piotr Dziwinski <piotrdz@gmail.com> | 2014-01-18 19:20:40 +0100 |
---|---|---|
committer | Piotr Dziwinski <piotrdz@gmail.com> | 2014-01-18 19:24:08 +0100 |
commit | 181a4049309600ef31c2d22b3823429c6ee331df (patch) | |
tree | f05825c8b59bc1daf4ce37cb2b16407491d1b524 /src/object/robotmain.cpp | |
parent | 652dc6081df8dc73bc9f57c031420e498be71451 (diff) | |
download | colobot-181a4049309600ef31c2d22b3823429c6ee331df.tar.gz colobot-181a4049309600ef31c2d22b3823429c6ee331df.tar.bz2 colobot-181a4049309600ef31c2d22b3823429c6ee331df.zip |
Fixed warnings about unknown commands in scene files
Diffstat (limited to 'src/object/robotmain.cpp')
-rw-r--r-- | src/object/robotmain.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/object/robotmain.cpp b/src/object/robotmain.cpp index ced1127..b1cbe52 100644 --- a/src/object/robotmain.cpp +++ b/src/object/robotmain.cpp @@ -81,6 +81,9 @@ #include <iomanip> +#include <boost/regex.hpp> + + template<> CRobotMain* CSingleton<CRobotMain>::m_instance = nullptr; @@ -4050,9 +4053,14 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject) continue; } - if (Cmd(line, "Title")) continue; // Ignore - if (Cmd(line, "Resume")) continue; // Ignore - if (Cmd(line, "ScriptName")) continue; // Ignore + static const boost::regex titleCmdRe("Title\\.[A-Z]"); + static const boost::regex resumeCmdRe("Resume\\.[A-Z]"); + static const boost::regex scriptNameCmdRe("ScriptName\.[A-Z]"); + + if (boost::regex_match(GetCmd(line), titleCmdRe)) continue; // Ignore + if (boost::regex_match(GetCmd(line), resumeCmdRe)) continue; // Ignore + if (boost::regex_match(GetCmd(line), scriptNameCmdRe)) continue; // Ignore + if (Cmd(line, "ScriptFile") && !resetObject) { |