diff --git a/leaderboard.lua b/leaderboard.lua index 0bb73fc..abcf7b3 100644 --- a/leaderboard.lua +++ b/leaderboard.lua @@ -370,10 +370,6 @@ COM_AddCommand("exit", exitlevel) local function findMap(player, ...) local search = ... - if search == nil then - - return - end local hell = "\x85HELL" local tol = { @@ -382,7 +378,22 @@ local function findMap(player, ...) [TOL_RACE] = "\x88Race\x80", [TOL_MATCH] = "\x87\Battle\x80" } - local lvltype, map + local lvltype, map, lvlttl + + local zoneAct = function(zone, act, levelflags) + local z = "" + if zone != "" then + z = " " + zone + elseif not(levelflags & LF_NOZONE) then + z = " Zone" + end + if act != "" then + z = $ + " " + act + end + + return z + end + for i = 1, #mapheaderinfo do map = mapheaderinfo[i] @@ -390,20 +401,24 @@ local function findMap(player, ...) continue end - if map.lvlttl:lower():find(search:lower()) then + lvlttl = map.lvlttl + zoneAct(map.zonttl, map.actnum, map.levelflags) + + if not search or lvlttl:lower():find(search:lower()) then -- Only care for up to TOL_MATCH (0x10) lvltype = tol[map.typeoflevel & 0x1F] or map.typeoflevel -- If not battle print numlaps - lvltype = (map.typeoflevel & (TOL_MATCH | TOL_COOP) and lvltype) or string.format("%s \x82%-2d\x80", lvltype, map.numlaps) + lvltype = (map.typeoflevel & (TOL_MATCH | TOL_COOP) and lvltype) + or string.format("%s \x82%-2d\x80", lvltype, map.numlaps) + CONS_Printf( player, string.format( - "%s %-9s %-25s - %s\t%s", + "%s %-9s %-30s - %s\t%s", G_BuildMapName(i), lvltype, - map.lvlttl, + lvlttl, map.subttl, (map.menuflags & LF2_HIDEINMENU and hell) or "" )