diff --git a/cmd/mtwebmapper/players.go b/cmd/mtwebmapper/players.go index 6212308..4fa5fad 100644 --- a/cmd/mtwebmapper/players.go +++ b/cmd/mtwebmapper/players.go @@ -23,7 +23,7 @@ var geoJSONTmpl = template.Must(template.New("geojson").Parse( "coordinates": [{{.Z}}, {{.X}}] }, "properties": { - "name": "{{.Name | html }}" + "name": "{{.Name | html }}" } }`)) diff --git a/mods/track_players/init.lua b/mods/track_players/init.lua index 1e0394b..71b8aa0 100644 --- a/mods/track_players/init.lua +++ b/mods/track_players/init.lua @@ -13,6 +13,9 @@ function players_data() z = pos.z } table.insert(ps, data) end + if table.getn(ps) == 0 then + return '[]\n' + end return minetest.write_json(ps) .. '\n' end