| 78 | // |
| 79 | |
| 80 | bool WorldScript::parseWorld(const std::string& _filename, |
| 81 | const std::map<std::string, std::string>& _customObjects, |
| 82 | ObjectCallback _objectCallback, |
| 83 | OptionCallback _optionCallback) { |
| 84 | reset(); |
| 85 | |
| 86 | filename = _filename; |
| 87 | customObjects = _customObjects; |
| 88 | objectCallback = _objectCallback; |
| 89 | optionCallback = _optionCallback; |
| 90 | |
| 91 | L = luaL_newstate(); |
| 92 | |
| 93 | L2WS_PTR(L) = this; |
| 94 | |
| 95 | setupLuaEnv(); |
| 96 | |
| 97 | if (luaL_dofile(L, filename.c_str()) != 0) { |
| 98 | debugf(0, "lua init error: %s\n", lua_tostring(L, -1)); |
| 99 | lua_pop(L, 1); |
| 100 | reset(); |
| 101 | return false; |
| 102 | } |
| 103 | |
| 104 | return true; |
| 105 | } |
| 106 | |
| 107 | //============================================================================// |
| 108 | //============================================================================// |
nothing calls this directly
no test coverage detected