MV Plugin Interaction Issue (ElevationFix + FollowerEventTouch)

I'm using Shaz_ElevationFix and HIME_FollowerEventTouch.

The former means that (when enabled) wandering events can't touch the player if they wouldn't be able to move into the player's space. This works.

The latter means that (when enabled) a wandering event will be triggered if it touches a follower. This also works.

However, events can still touch followers even if they wouldn't be able to move into the player's space. They can't touch the leader, but they can touch the followers.

Does anyone know how this could be fixed so that the elevation fix also applies to followers?
Doesn't it work if you just add the same isMapPassable check it does with the game player position to when it checks the follower positions?
That would make sense. I haven't found the proper place to put that check though.
There's no doubt multiple ways to do it, but maybe just change Shaz plugin (before it uses start) to check below. Didn't have the energy to test though (and not even 100% sure if you get the follower position like that LOL).

if (this._touchedFollower) {
var fx = this._touchedFollower._x;
var fy = this._touchedFollower._y;
var x = this.x;
var y = this.y;
var d = fx < x ? 4 : fx > x ? 6 : fy < y ? 8 : fy > y ? 2 : fx === x && fy === y ? 10 : 0;
if (!this.isMapPassable(x, y, d)) {return;}
}
wont this work (untested)?
JavaScript:
    {
        var px = $gamePlayer.x || this._touchedFollower._x;
        var py = $gamePlayer.y || this._touchedFollower._y;
        var x = this.x;
        var y = this.y;
        var d = (px < x) ? 4 : (px > x) ? 6 : (py < y) ? 8 : (py > y) ? 2 : (px === x && py === y) ? 10 : 0;
        if (!this.isMapPassable(x, y, d)) { return; }
      }

so it take the 1 or the other?
Ok I tested it, and it seemed to work (according to my quick test) when I also changed the order in the onFollowerTouch function to put the _touchedFollower assigment at the beginning.

PS. ShadowDragon, if you would write that part like that, doesn't it just always give the variable the player x/y value, since it always exists?
PS. ShadowDragon, if you would write that part like that, doesn't it just always give the variable the player x/y value, since it always exists?
I don't know how it exactly work, but if the player is on xy (x 23, y12) than it take that
for the player, if the follower is on that position, gamePlayer fails and follower take place?

its untested, so I cannot tell.

but you could check for the "if ($gamePlayer || this._followerTouch)"
as well beforehand, as 1 fails, 1 is true, it takes whatever is true.

but it might be different in this case, but it worth a try though.

like: if you have player ?? follower than if player fails on xy you check on touch,
player = false, so follower is true.
Okay, I tested @rpgLord69 's fix and it seems to work, so thanks for the help!

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/plugin-interaction-issue-elevationfix-followereventtouch.179710/