Feel weird posting so much, but I ran into another problem. I usually try to check many times if it's not my error, but here I ran out of ideas what might be wrong, especially that other 2 functions prove I'm right.
Problem: asITypeInfo::GetMethodByDecl() returns null for a method that exists in a class and can be found with GetMethodByName() and GetMethodByIndex()
C++ code:
std::cout << "=== by index === \n";
int count = typeInfo->GetMethodCount();
for(int i = 0; i < count; i++)
{
asIScriptFunction* f = typeInfo->GetMethodByIndex(m);
std::cout << "idx=" << m << ", funcdecl=" << f->GetDeclaration() << "\n";
}
std::cout << "=== by name === \n";
asIScriptFunction* f = typeInfo->GetMethodByName("foobar");
std::cout << f->GetDeclaration() << std::endl;
std::cout << "=== by decl === \n";
asIScriptFunction* f2 = typeInfo->GetMethodByDecl(f->GetDeclaration()); // I even send f->GetDeclaration() here from
// previous fetch to be 100% sure I didn't make
// a typo, and it still returns 0
std::cout << f2->GetDeclaration() << std::endl;
AS code:
class Foo
{
}
class Player
{
void foobar(Foo@ f)
{
}
}
Output:
=== by index ===
PS. Anyone knows why GameDev filters post title in this weird way? Doesn't make it more readable, to be honest :/