From f75a2ea0084ebe742ff19352abb491d8d4a2869b Mon Sep 17 00:00:00 2001 From: Coder12a <38924418+Coder12a@users.noreply.github.com> Date: Sat, 27 Oct 2018 13:40:37 -0500 Subject: [PATCH] Bug fix delrank When you delete a rank like member the faction will still give new players that rank and cause errors because the rank is deleted. --- factions.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/factions.lua b/factions.lua index 7952c2f..e7dc531 100644 --- a/factions.lua +++ b/factions.lua @@ -529,6 +529,14 @@ function factions.Faction.delete_rank(self, rank, newrank) end self.ranks[rank] = nil self:on_delete_rank(rank, newrank) + if rank == self.default_leader_rank then + self.default_leader_rank = newrank + self:broadcast("The default leader rank has been set to "..newrank) + end + if rank == self.default_rank then + self.default_rank = newrank + self:broadcast("The default rank given to new players is set to "..newrank) + end factions.save() end