I think I may have brought this up a long time ago, but I finally have a reproducible case in my code.
I can try and create a minimal case for it later, but here is the general idea:
When I call a inherited method from a parent class in a multiple inheritance hierarchy, I get undefended behavior (either a crash or non-sense return values):
class GameObject;
class Creep : public GameObject;
class Drawable {
int someFunc();
}
class CreepClient : public Creep, public Drawable;
// ==========================================================================
// Then I register CreepClient with AS, and some of the methods of Drawable:
// ==========================================================================
r = engine->RegisterObjectMethod("CreepClient", "int someFunc()", asMETHOD(CreepClient, someFunc), asCALL_THISCALL); assert( r >= 0 );
Then in my script I have something like:
void scriptFunc( CreepClient@ c ) {
int i = c.someFunc();
print( i ); // This prints non-sense
}
But really it's any method called from the Drawable base class.
I found how ever, that if I use the "asMETHODPR" macro instead, it all works :)