summaryrefslogtreecommitdiffstats
path: root/src/script/cbottoken.cpp
diff options
context:
space:
mode:
authorXienDev <XienDev@gmail.com>2013-04-28 16:49:48 +0300
committerXienDev <XienDev@gmail.com>2013-04-28 16:49:48 +0300
commit6a4ac9ce1614052b25fea0a0c0572d0ee1afbdff (patch)
tree97572b8133f6bafcfdf9337268304bb0b17f1e97 /src/script/cbottoken.cpp
parent0ce02b21f40ed8a0086dffe2c4bb01eeff942e58 (diff)
downloadcolobot-6a4ac9ce1614052b25fea0a0c0572d0ee1afbdff.tar.gz
colobot-6a4ac9ce1614052b25fea0a0c0572d0ee1afbdff.tar.bz2
colobot-6a4ac9ce1614052b25fea0a0c0572d0ee1afbdff.zip
Added functions "canbuild(category)" and "buildinfo(category)"
Also fixed issue with undefined behaviour of build(category) function
Diffstat (limited to 'src/script/cbottoken.cpp')
-rw-r--r--src/script/cbottoken.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/script/cbottoken.cpp b/src/script/cbottoken.cpp
index 0bd52da..6eb6592 100644
--- a/src/script/cbottoken.cpp
+++ b/src/script/cbottoken.cpp
@@ -262,6 +262,8 @@ std::string GetHelpFilename(const char *token)
if ( strcmp(token, "turn" ) == 0 ) return std::string("help/") + CApplication::GetInstancePointer()->GetLanguageChar() + std::string("/cbot/turn.txt");
if ( strcmp(token, "goto" ) == 0 ) return std::string("help/") + CApplication::GetInstancePointer()->GetLanguageChar() + std::string("/cbot/goto.txt");
if ( strcmp(token, "grab" ) == 0 ) return std::string("help/") + CApplication::GetInstancePointer()->GetLanguageChar() + std::string("/cbot/grab.txt");
+ if ( strcmp(token, "buildinfo" ) == 0 ) return std::string("help/") + CApplication::GetInstancePointer()->GetLanguageChar() + std::string("/cbot/buildinfo.txt");
+ if ( strcmp(token, "canbuild" ) == 0 ) return std::string("help/") + CApplication::GetInstancePointer()->GetLanguageChar() + std::string("/cbot/canbuild.txt");
if ( strcmp(token, "build" ) == 0 ) return std::string("help/") + CApplication::GetInstancePointer()->GetLanguageChar() + std::string("/cbot/build.txt");
if ( strcmp(token, "drop" ) == 0 ) return std::string("help/") + CApplication::GetInstancePointer()->GetLanguageChar() + std::string("/cbot/drop.txt");
if ( strcmp(token, "sniff" ) == 0 ) return std::string("help/") + CApplication::GetInstancePointer()->GetLanguageChar() + std::string("/cbot/sniff.txt");
@@ -380,7 +382,9 @@ bool IsFunction(const char *token)
if ( strcmp(token, "turn" ) == 0 ) return true;
if ( strcmp(token, "goto" ) == 0 ) return true;
if ( strcmp(token, "grab" ) == 0 ) return true;
- if ( strcmp(token, "build" ) == 0 ) return true;
+ if ( strcmp(token, "buildinfo" ) == 0 ) return true;
+ if ( strcmp(token, "canbuild" ) == 0 ) return true;
+ if ( strcmp(token, "build" ) == 0 ) return true;
if ( strcmp(token, "drop" ) == 0 ) return true;
if ( strcmp(token, "sniff" ) == 0 ) return true;
if ( strcmp(token, "receive" ) == 0 ) return true;
@@ -463,7 +467,9 @@ const char* GetHelpText(const char *token)
if ( strcmp(token, "turn" ) == 0 ) return "turn ( angle );";
if ( strcmp(token, "goto" ) == 0 ) return "goto ( position, altitude );";
if ( strcmp(token, "grab" ) == 0 ) return "grab ( order );";
- if ( strcmp(token, "build" ) == 0 ) return "build ( category );";
+ if ( strcmp(token, "buildinfo" ) == 0 ) return "buildinfo ( category );";
+ if ( strcmp(token, "canbuild" ) == 0 ) return "canbuild ( category );";
+ if ( strcmp(token, "build" ) == 0 ) return "build ( category );";
if ( strcmp(token, "drop" ) == 0 ) return "drop ( order );";
if ( strcmp(token, "sniff" ) == 0 ) return "sniff ( );";
if ( strcmp(token, "receive" ) == 0 ) return "receive ( name, power );";