From 65caefaf857895348623e926f8af2dbd7d27fef4 Mon Sep 17 00:00:00 2001 From: "Sascha L. Teichmann" Date: Tue, 10 Mar 2015 12:57:00 +0100 Subject: [PATCH] Fixed track_players mod. --- cmd/mtwebmapper/players.go | 2 +- mods/track_players/init.lua | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) 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