Finished most things

This commit is contained in:
Anthony Recascino 2016-07-31 11:43:04 -04:00
parent 63254c55fc
commit e3068026a4
2 changed files with 4 additions and 0 deletions

View File

@ -229,6 +229,7 @@ function factionsmod_chat.cmdhandler(playername,parameter)
--delete faction --delete faction
if cmd == "delete" then if cmd == "delete" then
factionsmod.member_remove(params[2],player)
if factionsmod.delete_faction(params[2]) then if factionsmod.delete_faction(params[2]) then
minetest.chat_send_player(playername, minetest.chat_send_player(playername,
"factionsmod: deleted faction " .. params[2], "factionsmod: deleted faction " .. params[2],

View File

@ -238,6 +238,9 @@ end
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
function factionsmod.delete_faction(name) 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.data.factionsmod[name] = nil
factionsmod.save() factionsmod.save()