Need to reference map database name, not map display name.

Hey guys. Here's a small snippet from a script I'm using that calls the map's display name and writes it on the screen. 

self.contents.draw_text(x, y, 125, 25, @mapname.to_s, 0) 

Now, I don't want it do to this. I want it to use the map name in the database/map tree (so just the actual map name itself). Anyone know what I need to change in the string to make that happen?
Where are you using that line?
Thanks for the fast reply! It's in Moghunter's save menu, which shows your location on each save file. It draws it from the map's display name, but I want it to use a map's database name in the map tree, like Yanfly's save menu,

This is the script in question: http://pastebin.com/uwLJzta3
Find this line:

header[:map_name] = $game_map.display_nameand change it to:

header[:map_name] = $dataMapInfos[$gameMap._mapId].namePlease note that if there's anything else on that script that uses the display name, it will also change to the map name with this. Let me know if that's a problem.
Hey, gave it a try and it's suddenly disabled all forms of saving entirely. I can access the save menu, but I'm simply getting the buzzer/error sound whenever I try to save. I tried starting a fresh game and then tried to save, but it still yielded the same result.
That happens when an error occurs while saving. There should be something on the console, can you tell me what it is
I'm not sure what you mean by the console?
Press F8 while play testing. It will open another window with some information. There should be an error message printed there.
I've never heard of that before! F8 does nothing for me at all, are you sure that feature wasn't introduced in MV?
OMG, I'm sorry, I hadn't realized you were talking about ace. Wait just a second and I'll get the fixed code.

Edit, ok, for the same line, this should be the right code:

Code:
header[:map_name] = $data_mapinfos[$game_map.map_id].name
Haha, no worries! Thanks for at least trying to help so far!
Just updated the previous post with this line:

Code:
header[:map_name] = $data_mapinfos[$game_map.map_id].name
Ah, that worked brilliantly! Thanks a bunch!

Original thread: https://forums.rpgmakerweb.com/threads/need-to-reference-map-database-name-not-map-display-name.53332/