diff --git a/init.lua b/init.lua index 06928af..08bbb39 100644 --- a/init.lua +++ b/init.lua @@ -1,6 +1,5 @@ modpol = {} - -- =================================================================== --preoverrides: certain things must be predefined in the global table for them to have effect (or cmd line version defualts are used) -- =================================================================== diff --git a/modpol_minetest/chatcommands/chatcommands.lua b/modpol_minetest/chatcommands/chatcommands.lua index e9e633f..3d07033 100644 --- a/modpol_minetest/chatcommands/chatcommands.lua +++ b/modpol_minetest/chatcommands/chatcommands.lua @@ -2,9 +2,10 @@ -- Minetest commands -- =================================================================== +command_list = {} -- user-facing table of commands + local chat_table -- MT chat command definitions table local regchat -- Chat-command registration function -local command_list = {} -- user-facing list of commands regchat = minetest.register_chatcommand @@ -25,6 +26,21 @@ regchat( end, }) +-- =================================================================== +-- /reset +-- For testing only +-- Clears the system and recreates instance with all players +regchat( + "reset", { + privs = {}, + func = function(user) + modpol.reset_orgs(); + return true, "Reset orgs" + end, +}) + + + -- =================================================================== -- /addorg /add_org -- This code defines a chat command which creates a new diff --git a/modpol_minetest/orgs/instance.lua b/modpol_minetest/orgs/instance.lua index 8e2ea50..99c1d98 100644 --- a/modpol_minetest/orgs/instance.lua +++ b/modpol_minetest/orgs/instance.lua @@ -2,5 +2,5 @@ minetest.register_on_joinplayer(function(player) local p_name = player:get_player_name() - modpol.add_member("instance", p_name) -end) \ No newline at end of file + modpol.add_member(1, p_name) +end) diff --git a/modpol_minetest/overrides/interactions/interactions.lua b/modpol_minetest/overrides/interactions/interactions.lua index 800cea9..7e37b6b 100644 --- a/modpol_minetest/overrides/interactions/interactions.lua +++ b/modpol_minetest/overrides/interactions/interactions.lua @@ -8,7 +8,7 @@ modpol.menu = function(user) local output = "Command list:" for key,value in pairs(command_list) do - output = output .. "/" .. key .. "\n" + output = output .. "/" .. value .. " " end return output end