From a79c752c4017ebcf256eeb26c0b2d02d25d94743 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Fri, 26 Jun 2015 05:18:24 -0400 Subject: [PATCH] keyword --> current_keyword --- signs_lib/init.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/signs_lib/init.lua b/signs_lib/init.lua index 6c738e84..ee00b7d0 100644 --- a/signs_lib/init.lua +++ b/signs_lib/init.lua @@ -11,7 +11,7 @@ -- } -- CWz's keyword interact mod uses this setting. -local keyword = minetest.setting_get("interact_keyword") or "iaccept" +local current_keyword = minetest.setting_get("interact_keyword") or "iaccept" signs_lib = {} screwdriver = screwdriver or {} @@ -367,7 +367,7 @@ end local function split_lines_and_words(text) if not text then return end - text = string.gsub(text, "@KEYWORD", keyword) + text = string.gsub(text, "@KEYWORD", current_keyword) local lines = { } for _, line in ipairs(text:split("\n")) do table.insert(lines, line:split(" ")) @@ -539,19 +539,19 @@ signs_lib.update_sign = function(pos, fields, owner) if fields then -- ...we're editing the sign. if fields.text and string.find(dump(fields.text), "@KEYWORD") then - meta:set_string("keyword", keyword) + meta:set_string("keyword", current_keyword) else meta:set_string("keyword", nil) end elseif string.find(dump(stored_text), "@KEYWORD") then -- we need to check if the password is being set/changed local stored_keyword = meta:get_string("keyword") - if stored_keyword and stored_keyword ~= "" and stored_keyword ~= keyword then + if stored_keyword and stored_keyword ~= "" and stored_keyword ~= current_keyword then signs_lib.destruct_sign(pos) - meta:set_string("keyword", keyword) + meta:set_string("keyword", current_keyword) local ownstr = "" if owner then ownstr = "Locked sign, owned by "..owner.."\n" end - meta:set_string("infotext", ownstr..string.gsub(make_infotext(stored_text), "@KEYWORD", keyword).." ") + meta:set_string("infotext", ownstr..string.gsub(make_infotext(stored_text), "@KEYWORD", current_keyword).." ") end end @@ -564,7 +564,7 @@ signs_lib.update_sign = function(pos, fields, owner) local ownstr = "" if owner then ownstr = "Locked sign, owned by "..owner.."\n" end - meta:set_string("infotext", ownstr..string.gsub(make_infotext(fields.text), "@KEYWORD", keyword).." ") + meta:set_string("infotext", ownstr..string.gsub(make_infotext(fields.text), "@KEYWORD", current_keyword).." ") meta:set_string("text", fields.text) meta:set_int("__signslib_new_format", 1)