Dash through

Hello there,
Is it possible to make it so that when the player dashes, it can go through event BUT cannot go through impassable tile?
ALL events? What about events that have a sprite from the tileset?
ALL events? What about events that have a sprite from the tileset?
Hmm... yea, I want it to not pass through those kinds of events too if possible.
Try this. Thoughts @Shaz ?
Ruby:
class Game_Player < Game_Character
  def passable?(x, y, d)
    x2 = $game_map.round_x_with_direction(x, d)
    y2 = $game_map.round_y_with_direction(y, d)
    return false unless $game_map.valid?(x2, y2)
    return true if @through || debug_through?
    id = $game_map.event_id_xy(x2,y2)
    evpass = false
    if id != 0
      evpass = $game_map.events[id].tile_id == 0 ? true : false
    end
    return true if dash? && evpass && $game_map.passable?(x2, y2, d)
    return false unless map_passable?(x, y, d)
    return false unless map_passable?(x2, y2, reverse_dir(d))
    return false if collide_with_characters?(x2, y2)
    return true
  end
end
I think putting this in Game_CharacterBase might allow events to go through other events if the player is dashing?

Would also have to cater for the possibility of an event (without a tile sprite) being on an impassable tile. Maybe put the dash test below the two map_passable tests?

Everything else seems good, but I'm a bit tired atm to follow it all properly.

Also, no need to define events in Game_Map because there's already an attr_reader for it in the class.
Good point, I didn't think about the parent tree. I usually end up placing things where they were originally found until I clue in.
It was weird because through my tests to get this whenever I mentioned $game_map.events[id].tile_id it gave me a no method error on tile_id for nil, nil class. But now it works fine. Must have been the way I originally had it before getting to this solution.

You're right about the event on an impassible tile. The player steps into the tile, then can't move.
*Fixed
Thank you @Roninator2! It works!

Original thread: https://forums.rpgmakerweb.com/threads/dash-through.142503/