Changeset 6665 for code/branches/gamestates2/data/lua
- Timestamp:
- Mar 31, 2010, 2:36:48 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gamestates2/data/lua/LuaStateInit.lua
r6662 r6665 41 41 return nil 42 42 end 43 43 44 if not _LOADED then 44 45 _LOADED = {} 45 46 end 46 if _LOADED[moduleName] == nil then 47 -- save old value 47 if not _LOADED_RETURN_VALUES then 48 _LOADED_RETURN_VALUES = {} 49 end 50 51 if not _LOADED[moduleName] then 52 -- save old value for the required name 48 53 local _REQUIREDNAME_OLD = _REQUIREDNAME 49 54 _REQUIREDNAME = moduleName 55 50 56 luaState:doFile(moduleName .. ".lua") 51 57 -- LuaStateReturnValue is required because if the file returns a table, 52 58 -- it cannot be passed through the C++ function 53 if LuaStateReturnValue == nil then -- C-injected global variable 54 LuaStateReturnValue = true 55 end 56 _LOADED[moduleName] = LuaStateReturnValue -- This entry must never be nil 59 _LOADED_RETURN_VALUES[moduleName] = LuaStateReturnValue 60 _LOADED[moduleName] = true 61 57 62 -- restore old value 58 63 _REQUIREDNAME = _REQUIREDNAME_OLD 59 64 end 60 return _LOADED[moduleName] 65 local asdf = _LOADED_RETURN_VALUES[moduleName] 66 return asdf 61 67 end 62 68
Note: See TracChangeset
for help on using the changeset viewer.