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

Method hasScript

components/lua/scriptscontainer.cpp:201–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199 }
200
201 bool ScriptsContainer::hasScript(int scriptId) const
202 {
203 return std::visit(
204 [&](auto&& variant) {
205 using T = std::decay_t<decltype(variant)>;
206 if constexpr (std::is_same_v<T, UnloadedData>)
207 {
208 for (const ESM::LuaScript& script : variant.mScripts)
209 {
210 if (script.mScriptId == scriptId)
211 return true;
212 }
213 return false;
214 }
215 else
216 {
217 static_assert(std::is_same_v<T, LoadedData>, "Non-exhaustive visitor");
218 return variant.mScripts.count(scriptId) != 0;
219 }
220 },
221 mData);
222 }
223
224 void ScriptsContainer::removeScript(int scriptId)
225 {

Callers 3

TEST_FFunction · 0.80
addBasicBindingsFunction · 0.80

Calls 2

visitFunction · 0.85
countMethod · 0.45

Tested by 1

TEST_FFunction · 0.64