diff --git a/code/_globalvars/station.dm b/code/_globalvars/station.dm index e1e5d4a5e1e..c6b4658d446 100644 --- a/code/_globalvars/station.dm +++ b/code/_globalvars/station.dm @@ -8,4 +8,6 @@ var/list/powernets = list() // this is not strictly unused although the whole modules datum thing is unused // To remove this you need to remove that -var/datum/moduletypes/mods = new() \ No newline at end of file +var/datum/moduletypes/mods = new() + +var/map_name = "Unknown" //The name of the map that is loaded. Assigned in world/New() \ No newline at end of file diff --git a/code/world.dm b/code/world.dm index f09a14cf4ef..860536fba51 100644 --- a/code/world.dm +++ b/code/world.dm @@ -88,6 +88,20 @@ process_ghost_teleport_locs() //Sets up ghost teleport locations. sleep_offline = 1 + var/list/lines = file2list(file('tgstation.dme')) + for(var/l in lines) + if( dd_hassuffix(l, ".dmm\"") ) + var/firstquote = findtext(l, "\"") + var/lastslash = 0 + for(var/j = 1; j < length(l); j++) + var/lastslashtest = findtext(l, "\\", -j) + if(lastslashtest > 0) + lastslash = lastslashtest + break + map_name = copytext(l, max(firstquote+1,lastslash+1), length(l)-4) + if(!map_name) + map_name = "Unknown" + spawn(3000) //so we aren't adding to the round-start lag if(config.kick_inactive) KickInactiveClients() @@ -149,6 +163,7 @@ s["gamestate"] = 1 if(ticker) s["gamestate"] = ticker.current_state + s["map_name"] = map_name ? map_name : "Unknown" return list2params(s)