Is there a method on SceneManager that checks if a scene is currently on the stack?

If you do something like:

SceneManager.push(SomeScene)SceneManager.goTo(OtherScene)You will automatically go to that other scene, regardless of if SomeScene is running or not. How can I say: If SomeScene is not popped off, do not go to OtherScene?

Would I do that in the SomeScene for the update  method when I listen for player input to hit escape? or is there another way?
Nope, but you can access the array of scenes with SceneManager._stack.

This is something that usually shouldn't be needed. Do you mind if I ask what you are trying to achieve?

When you call SceneManager.goto, the previous scene is terminated.
I need to watch, in the Scene_Base.prototype.checkGameover for a specific scene if its still active. If it isn't, if you hit escape then it should use goto game over. the problem with the stack is that only AFTER it goes to game over do I see that Scene_Item was added to the stack. oO I was hoping there would be a "is Scene active" method. Which I didn't see.
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.


at OP's request.

Original thread: https://forums.rpgmakerweb.com/threads/is-there-a-method-on-scenemanager-that-checks-if-a-scene-is-currently-on-the-stack.50691/