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.
This commit is contained in:
Coder12a 2018-10-27 13:40:37 -05:00
parent e7fff79b78
commit f75a2ea008

View File

@ -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