My C++ application ‘asynchronously’ loads a scene that contains a ScriptInstance attached to an otherwise empty node… it’s just a simplified test for c++/angelscript interop.
I rely on Urho to instantiate the test angelscript object during scene loading…
The following script appears to run without problems in the (old) editor, but when called from a c++ app built against the current master branch (with no changes to the codebase), the commented lines cause Urho to crash when the Update script method “tries” to return to Scene::Update… basically I’m trying to get access, from within script, to the scene which owns the node which owns the ScriptInstance…
No exception is generated by angelscript - execution of the method always completes, but “on the way out” (as we return to caller Scene::Update) we crash for some odd reason in StringHash equality compare with a clearly corrupted callstack (RAX holds an invalid pointer sourced from a corrupt input parameter on the stackframe).
What am I doing wrong here, that could cause stack corruption on the c++ call stack?
class Actor:ScriptObject
{
String actorName="zombie1";
Node@ ownNode_;
bool hasTarget_;
Actor@ Target_;
}
class Zombie:Actor
{
void Start(){
ownNode_ = node;
}
void Update(float dT){
Print("Update ZOMBIE: "+actorName);
// Scene@ myScene = scene;
// if(myScene is null)
// return;
Print("DONE!");
}