mirror of
https://github.com/etlegacy/wolfadmin.git
synced 2024-11-10 06:41:53 +00:00
Fixed !listmaps not producing any output (refs #62)
This commit is contained in:
parent
53e31020a1
commit
78139e6e0f
1 changed files with 11 additions and 5 deletions
|
@ -22,15 +22,21 @@ local commands = require (wolfa_getLuaPath()..".commands.commands")
|
|||
local game = require (wolfa_getLuaPath()..".game.game")
|
||||
|
||||
function commandListMaps(clientId, command)
|
||||
local output = ""
|
||||
|
||||
local maps = game.getMaps()
|
||||
|
||||
|
||||
if #maps == 0 then
|
||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dlistmaps: ^9no map information available.\";")
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
local output = ""
|
||||
|
||||
for _, map in ipairs(maps) do
|
||||
local prefix = "^9"
|
||||
if map == game.getMap() then prefix = "^7" end
|
||||
|
||||
output = (output ~= "") and output.." "..prefix..map or map
|
||||
|
||||
output = (output ~= "") and output.." "..prefix..map or prefix..map
|
||||
end
|
||||
|
||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dlistmaps: ^9"..output.. "\";")
|
||||
|
|
Loading…
Reference in a new issue