Eight Directional Movement + CP Terrains Tags

I'm using Tsukihime Eight Directional Movement and then started using NeonBlack CP Terrain Tags. Terrain tags overwrites move_by_input as 8DM does, but I can't figure out how to make them work together. If 8DM gets the overwrite, slopes diagonal movement do not work, while bridges still work, but you are unable to access the lower floor again (upper floor access regions get blocked) or can access them via the lower floor entrance.
6PMpE0K.gif
It's not just the script compatibility. the terrain tags is not done properly for that map.
Do this
1722479449845.png


Then this patch will work.
Put below both scripts.
Ruby:
class Game_Player < Game_Character
  def move_by_input
    return if !movable? || $game_map.interpreter.running?
    move_modif_direction
  end
  def move_modif_direction
    dir = Input.dir8
    return if dir <= 0
    case dir
    when 4, 1, 7
      if region_id == CP::TERRAIN::DOWN_LEFT
        set_direction(4)
        move_slope(4, 2)
      elsif $game_map.region_id(@x - 1, @y) == CP::TERRAIN::DOWN_RIGHT
        set_direction(4)
        move_slope(4, 8)
      else
        case dir
        when 4
          move_straight(dir)
        when 1
          move_diagonal(4, 2)
        when 7
          move_diagonal(4, 8)
        end
      end
    when 6, 3, 9
      if region_id == CP::TERRAIN::DOWN_RIGHT
        set_direction(6)
        move_slope(6, 2)
      elsif $game_map.region_id(@x + 1, @y) == CP::TERRAIN::DOWN_LEFT
        set_direction(6)
        move_slope(6, 8)
      else
        case dir
        when 6
          move_straight(dir)
        when 3
          move_diagonal(6, 2)
        when 9
          move_diagonal(6, 8)
        end
      end
    else
      move_straight(dir)
    end
    $game_map.bridge_flip(region_id)
  end
end
Works like a charm! Thank you as always!

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/eight-directional-movement-cp-terrains-tags.170776/