Made Agent IDs rewrittable.

Added antag check for forging.
This commit is contained in:
xxalpha
2015-07-22 20:15:13 +01:00
parent dbf46a6b29
commit 1759d492f0
2 changed files with 23 additions and 17 deletions
+17 -17
View File
@@ -141,24 +141,24 @@ update_label("John Doe", "Clowny")
if(user.mind.special_role)
usr << "<span class='notice'>The card's microscanners activate as you pass it over the ID, copying its access.</span>"
/obj/item/weapon/card/id/syndicate/CtrlClick(mob/user)
if(loc == user)
if(istype(user, /mob/living) && user.mind)
if(user.mind.special_role)
var t = copytext(sanitize(input(user, "What name would you like to put on this card?", "Agent card name", registered_name ? registered_name : (ishuman(user) ? user.real_name : user.name))as text | null),1,26)
if(!t || t == "Unknown" || t == "floor" || t == "wall" || t == "r-wall") //Same as mob/new_player/prefrences.dm
if (t)
alert("Invalid name.")
return
registered_name = t
/obj/item/weapon/card/id/syndicate/attack_self(mob/user)
if(!src.registered_name)
//Stop giving the players unsanitized unputs! You are giving ways for players to intentionally crash clients! -Nodrak
var t = copytext(sanitize(input(user, "What name would you like to put on this card?", "Agent card name", ishuman(user) ? user.real_name : user.name)as text | null),1,26)
if(!t || t == "Unknown" || t == "floor" || t == "wall" || t == "r-wall") //Same as mob/new_player/prefrences.dm
if (t)
alert("Invalid name.")
return
src.registered_name = t
var u = copytext(sanitize(input(user, "What occupation would you like to put on this card?\nNote: This will not grant any access levels other than Maintenance.", "Agent card job assignment", "Assistant")as text | null),1,MAX_MESSAGE_LEN)
if(!u)
src.registered_name = ""
return
src.assignment = u
update_label()
user << "<span class='notice'>You successfully forge the ID card.</span>"
var u = copytext(sanitize(input(user, "What occupation would you like to put on this card?\nNote: This will not grant any access levels other than Maintenance.", "Agent card job assignment", "Assistant")as text | null),1,MAX_MESSAGE_LEN)
if(!u)
registered_name = ""
return
assignment = u
update_label()
user << "<span class='notice'>You successfully forge the ID card.</span>"
else
..()