From c5aca7d9a808acc848a09e4aa829a4ff721b03f9 Mon Sep 17 00:00:00 2001 From: Sokomine Date: Tue, 3 Aug 2021 19:18:42 +0200 Subject: [PATCH] actually print the debug output for variable changes --- quest_api.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/quest_api.lua b/quest_api.lua index c46d1a5..b3bd485 100644 --- a/quest_api.lua +++ b/quest_api.lua @@ -124,6 +124,21 @@ yl_speak_up.set_quest_variable_value = function(player_name, variable_name, new_ if(not(variable_name) or not(player_name) or not(yl_speak_up.player_vars[ k ])) then return false end + if(yl_speak_up.player_vars[ k ]["$META$"] + and yl_speak_up.player_vars[ k ]["$META$"][ "debug" ] + and type(yl_speak_up.player_vars[ k ]["$META$"][ "debug" ]) == "table") then + for p, _ in pairs(yl_speak_up.player_vars[ k ]["$META$"][ "debug" ]) do + minetest.chat_send_player(p, "[Variable ".. + minetest.colorize("#FFFF00", tostring(k)).. + ", player ".. + minetest.colorize("#FFFF00", tostring(player_name)).. + "] old value: \"".. + minetest.colorize("#FFFF00", + tostring(yl_speak_up.player_vars[ k ][ player_name ])).. + "\" new value: \"".. + minetest.colorize("#FFFF00", tostring(new_value)).."\".") + end + end if(new_value ~= nil) then new_value = tostring(new_value) end