mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-09 23:50:25 +00:00
Cleanup: stredup-ing string variant for calling scripts
This commit is contained in:
parent
ab51175db2
commit
b1b578f988
@ -432,16 +432,6 @@ bool Squirrel::CallMethod(HSQOBJECT instance, const char *method_name, HSQOBJECT
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Squirrel::CallStringMethodStrdup(HSQOBJECT instance, const char *method_name, const char **res, int suspend)
|
||||
{
|
||||
HSQOBJECT ret;
|
||||
if (!this->CallMethod(instance, method_name, &ret, suspend)) return false;
|
||||
if (ret._type != OT_STRING) return false;
|
||||
*res = stredup(ObjectToString(&ret));
|
||||
StrMakeValidInPlace(const_cast<char *>(*res));
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Squirrel::CallStringMethod(HSQOBJECT instance, const char *method_name, std::string *res, int suspend)
|
||||
{
|
||||
HSQOBJECT ret;
|
||||
|
@ -159,7 +159,6 @@ public:
|
||||
*/
|
||||
bool CallMethod(HSQOBJECT instance, const char *method_name, HSQOBJECT *ret, int suspend);
|
||||
bool CallMethod(HSQOBJECT instance, const char *method_name, int suspend) { return this->CallMethod(instance, method_name, nullptr, suspend); }
|
||||
bool CallStringMethodStrdup(HSQOBJECT instance, const char *method_name, const char **res, int suspend);
|
||||
bool CallStringMethod(HSQOBJECT instance, const char *method_name, std::string *res, int suspend);
|
||||
bool CallIntegerMethod(HSQOBJECT instance, const char *method_name, int *res, int suspend);
|
||||
bool CallBoolMethod(HSQOBJECT instance, const char *method_name, bool *res, int suspend);
|
||||
|
Loading…
Reference in New Issue
Block a user