MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / parseWorld

Method parseWorld

src/world/WorldScript.cpp:80–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78//
79
80bool 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//============================================================================//

Callers

nothing calls this directly

Calls 3

debugfFunction · 0.85
c_strMethod · 0.80
luaL_newstateFunction · 0.50

Tested by

no test coverage detected