summaryrefslogtreecommitdiffstats
path: root/src/script
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2014-01-18 19:20:40 +0100
committerPiotr Dziwinski <piotrdz@gmail.com>2014-01-18 19:24:08 +0100
commit181a4049309600ef31c2d22b3823429c6ee331df (patch)
treef05825c8b59bc1daf4ce37cb2b16407491d1b524 /src/script
parent652dc6081df8dc73bc9f57c031420e498be71451 (diff)
downloadcolobot-181a4049309600ef31c2d22b3823429c6ee331df.tar.gz
colobot-181a4049309600ef31c2d22b3823429c6ee331df.tar.bz2
colobot-181a4049309600ef31c2d22b3823429c6ee331df.zip
Fixed warnings about unknown commands in scene files
Diffstat (limited to 'src/script')
-rw-r--r--src/script/cmdtoken.cpp10
-rw-r--r--src/script/cmdtoken.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/src/script/cmdtoken.cpp b/src/script/cmdtoken.cpp
index da4a886..6393505 100644
--- a/src/script/cmdtoken.cpp
+++ b/src/script/cmdtoken.cpp
@@ -35,6 +35,16 @@ char* SkipSpace(char *line)
return line;
}
+std::string GetCmd(char* line)
+{
+ line = SkipSpace(line);
+
+ int len = 0;
+ for(char* x = line; *x != 0 && *x != ' ' && *x != '\t' && *x != '\n'; x++, len++);
+
+ return std::string(line, len);
+}
+
// Checks if a line contains a command.
bool Cmd(char *line, const char *token)
diff --git a/src/script/cmdtoken.h b/src/script/cmdtoken.h
index 24b592f..8a423c5 100644
--- a/src/script/cmdtoken.h
+++ b/src/script/cmdtoken.h
@@ -30,6 +30,7 @@
// Procedures.
+extern std::string GetCmd(char* line);
extern bool Cmd(char *line, const char *token);
extern char* SearchOp(char *line, const char *op);