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

Method CallStringMethod

src/script/squirrel.cpp:410–420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

408}
409
410bool Squirrel::CallStringMethod(HSQOBJECT instance, std::string_view method_name, std::string *res, int suspend)
411{
412 HSQOBJECT ret;
413 if (!this->CallMethod(instance, method_name, &ret, suspend)) return false;
414
415 auto str = ObjectToString(&ret);
416 if (!str.has_value()) return false;
417
418 *res = StrMakeValid(*str);
419 return true;
420}
421
422bool Squirrel::CallIntegerMethod(HSQOBJECT instance, std::string_view method_name, int *res, int suspend)
423{

Callers 3

ConstructorMethod · 0.80
ConstructorMethod · 0.80
ConstructorMethod · 0.80

Calls 2

CallMethodMethod · 0.95
StrMakeValidFunction · 0.50

Tested by

no test coverage detected