[colobot] 15/62: Fix object.factory() code type detection, closes #938
Didier Raboud
odyx at moszumanska.debian.org
Fri Nov 10 11:53:54 UTC 2017
This is an automated email from the git hooks/post-receive script.
odyx pushed a commit to branch debian/master
in repository colobot.
commit bb35585194d11c70acdb2666b20b32a1e8a9d6dd
Author: krzys-h <krzys_h at interia.pl>
Date: Sat Jun 3 21:43:10 2017 +0200
Fix object.factory() code type detection, closes #938
---
src/object/auto/autofactory.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/object/auto/autofactory.cpp b/src/object/auto/autofactory.cpp
index 7dfc280..45fd357 100644
--- a/src/object/auto/autofactory.cpp
+++ b/src/object/auto/autofactory.cpp
@@ -405,12 +405,12 @@ bool CAutoFactory::EventProcess(const Event &event)
{
Program* program = dynamic_cast<CProgramStorageObject*>(vehicle)->AddProgram();
- if (boost::regex_search(m_program, boost::regex("^[A-Za-z0-9_]+$"))) // Public function name?
+ if (boost::regex_match(m_program, boost::regex("[A-Za-z0-9_]+"))) // Public function name?
{
std::string code = "extern void object::Start_"+m_program+"()\n{\n\t\n\t//Automatically generated by object.factory()\n\t"+m_program+"();\n\t\n}\n";
program->script->SendScript(code.c_str());
}
- else if (boost::regex_search(m_program, boost::regex("\\.txt$"))) // File name (with .txt extension)?
+ else if (boost::regex_match(m_program, boost::regex(".*\\.txt"))) // File name (with .txt extension)?
{
program->script->ReadScript(m_program.c_str());
}
--
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