diff options
author | yexo <yexo@openttd.org> | 2009-07-31 19:50:01 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2009-07-31 19:50:01 +0000 |
commit | c2ed8840123cc81f58b3db8d6341b22349b4ac78 (patch) | |
tree | 71e42277f511c8cdfa800e9d564d159e20b595ff /src/script | |
parent | 0bb3d7030ffdd336acd0131a00b93c6aa1b26419 (diff) | |
download | openttd-c2ed8840123cc81f58b3db8d6341b22349b4ac78.tar.xz |
(svn r17005) -Add [NoAI]: AIAbstractList::SORT_ASCENDING / SORT_DESCENDING
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/squirrel.cpp | 7 | ||||
-rw-r--r-- | src/script/squirrel.hpp | 6 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/script/squirrel.cpp b/src/script/squirrel.cpp index 3fb778043..31dcf6aea 100644 --- a/src/script/squirrel.cpp +++ b/src/script/squirrel.cpp @@ -131,6 +131,13 @@ void Squirrel::AddConst(const char *var_name, int value) sq_newslot(this->vm, -3, SQTrue); } +void Squirrel::AddConst(const char *var_name, bool value) +{ + sq_pushstring(this->vm, OTTD2FS(var_name), -1); + sq_pushbool(this->vm, value); + sq_newslot(this->vm, -3, SQTrue); +} + void Squirrel::AddClassBegin(const char *class_name) { sq_pushroottable(this->vm); diff --git a/src/script/squirrel.hpp b/src/script/squirrel.hpp index 32f24cb11..612c6ce2e 100644 --- a/src/script/squirrel.hpp +++ b/src/script/squirrel.hpp @@ -78,6 +78,12 @@ public: void AddConst(const char *var_name, int value); /** + * Adds a const to the stack. Depending on the current state this means + * either a const to a class or to the global space. + */ + void AddConst(const char *var_name, bool value); + + /** * Adds a class to the global scope. Make sure to call AddClassEnd when you * are done adding methods. */ |