Having trouble with Hime's Region name script.

Hello Everyone.

I seem to be having some technical difficulties with Hime's Region name script.


It allows you to assign a name (among other neat stuff )to each region through notetags. However, in my game I only use regions for my world map.

Here is the issue: When I walk my actors around the world map the map display name changes normally as I had assigned using this script, however, when I teleport my actors to other maps where there is no region assignment, even though I have given these mas specific map display names, the displayed name stays the same as the previous world map region the actors have been to, rather than the specific map display name I have assigned for that particular new map.

Is there any way to fix this?

Note: NO REGIONS are used in the other maps other than the world map.
Here are two scripts to patch the problem, that we made on a discord
I post the answer here if someone have the same problem

Ruby:
#==============================================================================
# ** Game_Player
#------------------------------------------------------------------------------
#  Patch to set the last_region_id back to 0
#==============================================================================

class Game_Player
  alias_method :reserve_transfer_before_region_patch, :reserve_transfer
  def reserve_transfer(map_id, x, y, d = 2)
    reserve_transfer_before_region_patch(map_id, x, y, d)
    @last_region_id = 0
  end
end

#==============================================================================
# ** Game_Map
#------------------------------------------------------------------------------
#  Patch to set the last_region_id back to 0
#==============================================================================
class Game_Map
  #--------------------------------------------------------------------------
  # * Setup
  #--------------------------------------------------------------------------
  alias_method :setup_before_region_patch, :setup
  def setup(map_id)
    setup_before_region_patch(map_id)
    @region_name = nil
  end
end

Original thread: https://forums.rpgmakerweb.com/threads/having-trouble-with-himes-region-name-script.119980/