From 05492cc921a643c4a26bae2445e233cd093cfd64 Mon Sep 17 00:00:00 2001 From: Ccomp5950 Date: Fri, 29 Nov 2013 15:07:39 -0600 Subject: [PATCH] Created a check to see if there is a registered user of the syndicate card, if there isn't it assignes the first person who tries to change their name with it as the registered user. --- code/game/objects/items/weapons/cards_ids.dm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/code/game/objects/items/weapons/cards_ids.dm b/code/game/objects/items/weapons/cards_ids.dm index 89d939c60e..45a2623fa5 100644 --- a/code/game/objects/items/weapons/cards_ids.dm +++ b/code/game/objects/items/weapons/cards_ids.dm @@ -199,19 +199,18 @@ name = "agent card" access = list(access_maint_tunnels, access_syndicate, access_external_airlocks) origin_tech = "syndicate=3" - registered_name=null var/registered_user=null /obj/item/weapon/card/id/syndicate/New(mob/user as mob) ..() - var t = reject_bad_name(input(user, "What name would you like to put on this card?\nNode: You can change this later by clicking on the ID card while it's in your hand.", "Agent card name", ishuman(user) ? user.real_name : user.name)) + var/t = reject_bad_name(input(user, "What name would you like to put on this card?\nNode: You can change this later by clicking on the ID card while it's in your hand.", "Agent card name", ishuman(user) ? user.real_name : user.name)) if(!t) alert("Invalid name.") if(!registered_name) registered_name = ishuman(user) ? user.real_name : user.name else 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")),1,MAX_MESSAGE_LEN) + 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")),1,MAX_MESSAGE_LEN) if(!u) alert("Invalid assignment.") assignment = "Assistant" @@ -249,7 +248,10 @@ src.name = "[src.registered_name]'s ID Card ([src.assignment])" user << "\blue You successfully forge the ID card." registered_user = user - else if(registered_user == user) + else if(!registered_user || registered_user == user) + + if(registered_user) registered_user = user // First one to pick it up is the owner if there is ever a wild case New() doens't work. + switch(alert("Would you like to display the ID, or retitle it?","Choose.","Rename","Show")) if("Rename") 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)),1,26)