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:
parent
e7fff79b78
commit
f75a2ea008
@ -529,6 +529,14 @@ function factions.Faction.delete_rank(self, rank, newrank)
|
|||||||
end
|
end
|
||||||
self.ranks[rank] = nil
|
self.ranks[rank] = nil
|
||||||
self:on_delete_rank(rank, newrank)
|
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()
|
factions.save()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user