From 8a56370ce8efd68d4ca54fde0bd6b5c37d35f601 Mon Sep 17 00:00:00 2001 From: upsilon Date: Tue, 27 Feb 2018 16:33:18 +0100 Subject: [PATCH] Allow using templates on multiple luacontrollers Fixes #8 Patch submitted by @oiaohm --- moremesecons_luacontroller_tool/init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/moremesecons_luacontroller_tool/init.lua b/moremesecons_luacontroller_tool/init.lua index 5d26036..a50876e 100644 --- a/moremesecons_luacontroller_tool/init.lua +++ b/moremesecons_luacontroller_tool/init.lua @@ -223,10 +223,10 @@ minetest.register_tool("moremesecons_luacontroller_tool:lctt", { return end - pdata[pname] = pdata[pname] or { + pdata[pname] = { pos = pos, player_name = pname, - template_name = next(templates[pname] or templates[next(templates)]), + template_name = pdata[pname] and pdata[pname].template_name or next(templates[pname] or templates[next(templates)]), } minetest.show_formspec(pname, "moremesecons:luacontroller_tool", get_selection_formspec(pdata[pname].player_name, pdata[pname].template_name)) end,