MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / CheckMethod

Method CheckMethod

src/script/script_info.cpp:22–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20#include "../safeguards.h"
21
22bool ScriptInfo::CheckMethod(std::string_view name) const
23{
24 if (!this->engine->MethodExists(this->SQ_instance, name)) {
25 this->engine->ThrowError(fmt::format("your info.nut/library.nut doesn't have the method '{}'", name));
26 return false;
27 }
28 return true;
29}
30
31/* static */ SQInteger ScriptInfo::Constructor(HSQUIRRELVM vm, ScriptInfo &info)
32{

Callers 3

ConstructorMethod · 0.80
ConstructorMethod · 0.80
ConstructorMethod · 0.80

Calls 3

MethodExistsMethod · 0.80
ThrowErrorMethod · 0.80
formatFunction · 0.50

Tested by

no test coverage detected