MCPcopy Create free account
hub / github.com/adventuregamestudio/ags / GetScriptInstance

Function GetScriptInstance

Engine/script/script.cpp:293–307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

291}
292
293RuntimeScript *GetScriptInstance(ScriptType sc_type, const String &script_module)
294{
295 if (sc_type == kScTypeRoom)
296 return roomscript.get();
297
298 if (script_module.IsEmpty() || script_module == gamescript->GetScriptName())
299 return gamescript.get();
300
301 for (size_t i = 0; i < numScriptModules; ++i)
302 {
303 if (script_module == scriptModules[i]->GetScriptName())
304 return scriptModules[i].get();
305 }
306 return nullptr;
307}
308
309bool DoesScriptFunctionExist(const RuntimeScript *script, const String &fn_name)
310{

Callers 2

Calls 2

getMethod · 0.45
IsEmptyMethod · 0.45

Tested by

no test coverage detected