Fixes check_rights runtiming for non-holders.

Fixes all kinds of errors.
This commit is contained in:
PsiOmegaDelta
2016-07-31 18:05:19 +02:00
committed by Yoshax
parent cfaada473b
commit de6d2a4a31

View File

@@ -62,21 +62,22 @@ NOTE: It checks usr by default. Supply the "user" argument if you wish to check
if(ismob(C)) if(ismob(C))
var/mob/M = C var/mob/M = C
C = M.client C = M.client
if(!C)
return FALSE
if(!C.holder)
if(show_msg)
C << "<span class='warning'>Error: You are not an admin.</span>"
return FALSE
if(C) if(rights_required)
if(rights_required) if(rights_required & C.holder.rights)
if(rights_required & C.holder.rights) return TRUE
return 1
else
if(show_msg)
C << "<font color='red'>Error: You do not have sufficient rights to do that. You require one of the following flags:[rights2text(rights_required," ")].</font>"
else else
if(C.holder) if(show_msg)
return 1 C << "<span class='warning'>Error: You do not have sufficient rights to do that. You require one of the following flags:[rights2text(rights_required," ")].</span>"
else return FALSE
if(show_msg) else
C << "<font color='red'>Error: You are not an admin.</font>" return TRUE
return 0
//probably a bit iffy - will hopefully figure out a better solution //probably a bit iffy - will hopefully figure out a better solution
/proc/check_if_greater_rights_than(client/other) /proc/check_if_greater_rights_than(client/other)