From bbc778f0ef289041acdf5f8e258764fc11d81f79 Mon Sep 17 00:00:00 2001 From: Sokomine Date: Mon, 12 Jul 2021 00:23:46 +0200 Subject: [PATCH] fixed bug in quest_api.lua: setting variables to nil is possible again --- quest_api.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/quest_api.lua b/quest_api.lua index 79bcacf..44213d7 100644 --- a/quest_api.lua +++ b/quest_api.lua @@ -92,7 +92,10 @@ 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 - yl_speak_up.player_vars[ k ][ player_name ] = tostring(new_value) + if(new_value ~= nil) then + new_value = tostring(new_value) + end + yl_speak_up.player_vars[ k ][ player_name ] = new_value -- a quest variable was changed - save that to disc (but no need to force it) yl_speak_up.save_quest_variables(false) return true