MCPcopy Create free account
hub / github.com/OpenMW/openmw / clearTemporaryAndRemoveCallbacks

Method clearTemporaryAndRemoveCallbacks

components/lua/storage.cpp:236–253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

234 }
235
236 void LuaStorage::clearTemporaryAndRemoveCallbacks()
237 {
238 auto it = mData.begin();
239 while (it != mData.end())
240 {
241 it->second->mCallbacks.clear();
242 // Note that we don't clear menu callbacks for permanent sections
243 // because starting/loading a game doesn't reset menu scripts.
244 if (it->second->mLifeTime == Section::Temporary)
245 {
246 it->second->mMenuScriptsCallbacks.clear();
247 it->second->mValues.clear();
248 it = mData.erase(it);
249 }
250 else
251 ++it;
252 }
253 }
254
255 void LuaStorage::load(lua_State* state, const std::filesystem::path& path)
256 {

Callers 3

TESTFunction · 0.80
clearMethod · 0.80
reloadAllScriptsImplMethod · 0.80

Calls 4

beginMethod · 0.45
endMethod · 0.45
clearMethod · 0.45
eraseMethod · 0.45

Tested by 1

TESTFunction · 0.64