| 291 | } |
| 292 | |
| 293 | RuntimeScript *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 | |
| 309 | bool DoesScriptFunctionExist(const RuntimeScript *script, const String &fn_name) |
| 310 | { |
no test coverage detected