From c2ed8840123cc81f58b3db8d6341b22349b4ac78 Mon Sep 17 00:00:00 2001 From: yexo Date: Fri, 31 Jul 2009 19:50:01 +0000 Subject: (svn r17005) -Add [NoAI]: AIAbstractList::SORT_ASCENDING / SORT_DESCENDING --- src/script/squirrel.cpp | 7 +++++++ src/script/squirrel.hpp | 6 ++++++ 2 files changed, 13 insertions(+) (limited to 'src/script') 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 @@ -77,6 +77,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. -- cgit v1.2.3-54-g00ecf