Preventing Player Touch events from activating in certain circumstances

I decided to make on map encounters for my project, which means that I have multiple events on a map which activate on Player Touch and start a battle. However, some time ago I noticed that if the player is standing on the adjacent tile to the event but on a different level, the event will activate nevertheless.


Here's a screenshot to clarify what I mean:


nNzoGXT.png



Currently this kind of situation causes the event to activate and the player get thrown into a battle even though neither of them is able to cross the cliff edge between them. Is there a way to prevent this from happening? While flying enemies might be able to touch player in this kind of situation, I'd rather not have all of my enemies behave in the same way.
This is a logic flaw/omission that has been with RPG Maker for a long, long time.  I wrote a script to fix it for Ace, but I don't recall if I converted it to MV.


later ...


Here you go.  Let me know (in that thread) if you have any problems:
Thank you, Shaz! The plugin fixed the issue perfectly.


This thread can now be closed.
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.

Original thread: https://forums.rpgmakerweb.com/threads/preventing-player-touch-events-from-activating-in-certain-circumstances.65360/