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

Function RunEventInModule

Engine/script/script.cpp:534–548  ·  view source on GitHub ↗

Run a single event callback in the specified script module; if the name is not provided, then tries to run it in global script.

Source from the content-addressed store, hash-verified

532// Run a single event callback in the specified script module;
533// if the name is not provided, then tries to run it in global script.
534static bool RunEventInModule(const ScriptFunctionRef &fn_ref, size_t param_count, const RuntimeScriptValue *params)
535{
536 if (!fn_ref.ModuleName.IsEmpty())
537 {
538 for (size_t i = 0; i < numScriptModules; ++i)
539 {
540 if (fn_ref.ModuleName.Compare(scriptModules[i]->GetScriptName()) == 0)
541 {
542 return RunScriptFunction(scriptModules[i].get(), fn_ref.FuncName, param_count, params) == kScFnRes_Done;
543 }
544 }
545 }
546 // Try global script last, for backwards compatibility
547 return RunScriptFunction(gamescript.get(), fn_ref.FuncName, param_count, params) == kScFnRes_Done;
548}
549
550// Run claimable event in all script modules, *including* room;
551// break if event was claimed by any of the run callbacks.

Callers 1

RunScriptFunctionAutoFunction · 0.85

Calls 4

RunScriptFunctionFunction · 0.85
IsEmptyMethod · 0.45
CompareMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected