From 0966a6585a7323aa4ede9c81e40cd5f4f096bce5 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 1 Aug 2016 17:57:37 +0200 Subject: Fix achievement unlock --- init.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index f96b5d9..caa44dc 100644 --- a/init.lua +++ b/init.lua @@ -704,7 +704,6 @@ if minetest.get_modpath("awards") ~= nil then description = "Read all help entries about blocks.", }) - -- TODO: Test this when the awards mod works again minetest.register_globalstep(function(dtime) -- Check awards every 30 seconds awardchecktime = awardchecktime + dtime @@ -712,9 +711,10 @@ if minetest.get_modpath("awards") ~= nil then awardchecktime = 30 - awardchecktime local players = minetest.get_connected_players() for p=1,#players do - local count = doc.get_viewed_count(players[p]:get_player_name(), "nodes") + local playername = players[p]:get_player_name() + local count = doc.get_viewed_count(playername, "nodes") if count ~= nil and count >= doc.get_entry_count("nodes") then - awards.unlock("doc_minetest_game_allnodes") + awards.unlock(playername, "doc_minetest_game_allnodes") end end end) -- cgit v1.2.3