diff --git a/chatcommands.lua b/chatcommands.lua index 3db29f6..ee29b6f 100644 --- a/chatcommands.lua +++ b/chatcommands.lua @@ -229,6 +229,7 @@ function factionsmod_chat.cmdhandler(playername,parameter) --delete faction if cmd == "delete" then + factionsmod.member_remove(params[2],player) if factionsmod.delete_faction(params[2]) then minetest.chat_send_player(playername, "factionsmod: deleted faction " .. params[2], diff --git a/factionsmod.lua b/factionsmod.lua index e3e0644..4f5692b 100644 --- a/factionsmod.lua +++ b/factionsmod.lua @@ -238,6 +238,9 @@ end ------------------------------------------------------------------------------- function factionsmod.delete_faction(name) + for k,v in pairs(factionsmod.dynamic_data.membertable[name]) do + factionsmod.member_remove(name,v) + end factionsmod.data.factionsmod[name] = nil factionsmod.save()