Changeset 6774 for code/branches/gamestates3/src/libraries/core
- Timestamp:
- Apr 23, 2010, 11:46:11 AM (15 years ago)
- Location:
- code/branches/gamestates3/src/libraries/core
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gamestates3/src/libraries/core/LuaState.cc
r6763 r6774 53 53 DeclareToluaInterface(Core); 54 54 55 LuaState::LuaState( )55 LuaState::LuaState(bool bStrict) 56 56 : bIsRunning_(false) 57 57 , includeParseFunction_(NULL) … … 82 82 tolua_pushusertype(luaState_, static_cast<void*>(this), "orxonox::LuaState"); 83 83 lua_setglobal(luaState_, "luaState"); 84 85 // Strict.lua ensures that global variables are not declared inside a function scope 86 if (bStrict) 87 { 88 if (!this->doFile("Strict.lua")) 89 ThrowException(InitialisationFailed, "Running Strict.lua failed"); 90 } 91 else 92 { 93 // Add dummy function for declaring global variables 94 this->doString("global = function(...) end"); 95 } 84 96 85 97 // Parse init script -
code/branches/gamestates3/src/libraries/core/LuaState.h
r6763 r6774 68 68 { // tolua_export 69 69 public: 70 LuaState( );70 LuaState(bool bStrict = true); 71 71 ~LuaState(); 72 72
Note: See TracChangeset
for help on using the changeset viewer.