From 7b8e7f7322c844f16d735419c1390535a2620e9f Mon Sep 17 00:00:00 2001 From: Sokomine Date: Wed, 5 Jan 2022 19:17:59 +0100 Subject: [PATCH] made check_variable accessible for excec_eval_preconditions.lua --- exec_eval_preconditions.lua | 4 ++-- fs_edit_preconditions.lua | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/exec_eval_preconditions.lua b/exec_eval_preconditions.lua index 2477110..ce26740 100644 --- a/exec_eval_preconditions.lua +++ b/exec_eval_preconditions.lua @@ -93,11 +93,11 @@ yl_speak_up.eval_precondition = function(player, n_id, p, other_options_true_or_ -- broken precondition return false -- "(internal) hour of ingame day", -- 2 - elseif(p.p_variable == check_variable[2]) then + elseif(p.p_variable == yl_speak_up.precondition_check_variable[2]) then -- timeofday is between 0..1; translate to 24 hours var_val = math.floor((minetest.get_timeofday() * 24)+0.5) -- "(internal) player's health points", -- 3 - elseif(p.p_variable == check_variable[3]) then + elseif(p.p_variable == yl_speak_up.precondition_check_variable[3]) then var_val = player:get_hp() else local pname = player:get_player_name() diff --git a/fs_edit_preconditions.lua b/fs_edit_preconditions.lua index edc1aff..0e2e990 100644 --- a/fs_edit_preconditions.lua +++ b/fs_edit_preconditions.lua @@ -148,7 +148,7 @@ local values_operator = {"", "==", "~=", ">=", ">", "<=", "<", "not", "is_set", "quest_step_done", "quest_step_not_done"} -- some internal ones... -local check_variable = { +yl_speak_up.precondition_check_variable = { -- "- please select -", -- this is automaticly added to the var list "(internal) hour of ingame day", -- 2 "(internal) player's health points", -- 3 @@ -159,7 +159,7 @@ local check_variable = { yl_speak_up.get_sorted_player_var_list_read_access = function(pname) local var_list = {} -- copy the values from check_variable - for i, v in ipairs(check_variable) do + for i, v in ipairs(yl_speak_up.precondition_check_variable) do table.insert(var_list, v) end -- get the list of variables the player can read