Skip to content

Commit

Permalink
improvements to vote restart when admins are on
Browse files Browse the repository at this point in the history
It will only count admins who can actually restart the server.

It will stop searching for admins once it finds one.

It will let the users and admins know that the restart vote will not automatically restart the server because of the active admins.
  • Loading branch information
MrStonedOne committed Aug 12, 2015
1 parent 0b65cab commit f176789
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions code/controllers/subsystem/voting.dm
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,14 @@ var/datum/subsystem/vote/SSvote
if(restart)
var/active_admins = 0
for(var/client/C in admins)
if(!C.is_afk())
active_admins++
if(active_admins <= 0)
if(!C.is_afk() && check_rights_for(C, R_SERVER))
active_admins = 1
break
if(!active_admins)
world.Reboot("Restart vote successful.", "end_error", "restart vote")
else
world << "<span style='boldannounce'>Notice:Restart vote will not restart the server automatically because there are active admins on.</span>"
message_admins("A restart vote has passed, but there are active admins on with +server, so it has been canceled. If you wish, you may restart the server.")

return .

Expand Down

0 comments on commit f176789

Please sign in to comment.