MV Function aliasing results in indefinite loading screen. Why?

I once again come to you with what is probably a pretty obvious mistake, but I can't figure it out. So when I start my game normally (new game) everything works just fine. What I want to do is modify:
JavaScript:
Scene_Map.prototype.isReady

So I add the following code:

JavaScript:
_DynamicCharacterSprite__Scene_Map_prototype_isReady = Scene_Map.prototype.isReady;
Scene_Map.prototype.isReady = function(){
    _DynamicCharacterSprite__Scene_Map_prototype_isReady.call(this);
}

As far as I can tell this code should literally do nothing. Right now it should just intercept the normal call for 'Scene_Map.prototype.isReady' and then call the actual function 'Scene_Map.prototype.isReady' and looking at the debugger, that is what is happening.
However, my game won't start anymore. If I start a new game with the only change being that added bit of code the game will get stuck in an indefinite loading screen.
1638216522457.png

What is going on here? Why does it do that and how do I prevent it from getting stuck in an infinite loop?
Your code will work if you change it to the following:
JavaScript:
_DynamicCharacterSprite__Scene_Map_prototype_isReady = Scene_Map.prototype.isReady;
Scene_Map.prototype.isReady = function(){
    return _DynamicCharacterSprite__Scene_Map_prototype_isReady.call(this);
}

The original isReady-function returns if the scene is ready - apparently this is used to determine how when it is no longer necessary to show the 'now loading' - screen. You intercept that with your own function. And while you do call the original, you don't pass on the value it returns. That currently just vanishes into the void.

Of course the return statement will cause the function to end. So if you want to execute some code after the call to the original function you need to do something like this:
JavaScript:
_DynamicCharacterSprite__Scene_Map_prototype_isReady = Scene_Map.prototype.isReady;
Scene_Map.prototype.isReady = function(){
    var result = _DynamicCharacterSprite__Scene_Map_prototype_isReady.call(this);
    //your custom code goes here
    return result;
}
The original isReady-function returns if the scene is ready
*insert me facepalming* Yeah, as I thought, a pretty obvious mistake... Thank you very much 🙂
Thread closed

Original thread: https://forums.rpgmakerweb.com/threads/function-aliasing-results-in-indefinite-loading-screen-why.142580/