From bc14b2374634452addbcb0aff750e017ab935280 Mon Sep 17 00:00:00 2001 From: "johnsonmt88@gmail.com" Date: Thu, 12 Apr 2012 22:52:49 +0000 Subject: [PATCH] - pAI names now have a character limit and are sanitized - Removed duplicate drink checks git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3446 316c924e-a436-60f5-8080-3fe189b3f50e --- code/modules/chemical/Chemistry-Tools.dm | 8 ----- .../modules/mob/living/silicon/pai/recruit.dm | 29 +++++++++++++++---- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/code/modules/chemical/Chemistry-Tools.dm b/code/modules/chemical/Chemistry-Tools.dm index 6566996b58b..ae7535db5b5 100644 --- a/code/modules/chemical/Chemistry-Tools.dm +++ b/code/modules/chemical/Chemistry-Tools.dm @@ -3110,14 +3110,6 @@ icon_state = "cubalibreglass" name = "Cuba Libre" desc = "A classic mix of rum and cola." - if("irishcream") - icon_state = "irishcreamglass" - name = "Irish Cream" - desc = "It's cream, mixed with whiskey. What else would you expect from the Irish?" - if("cubalibre") - icon_state = "cubalibreglass" - name = "Cuba Libre" - desc = "A classic mix of rum and cola." if("b52") icon_state = "b52glass" name = "B-52" diff --git a/code/modules/mob/living/silicon/pai/recruit.dm b/code/modules/mob/living/silicon/pai/recruit.dm index 4d4c7a12b27..cd875023668 100644 --- a/code/modules/mob/living/silicon/pai/recruit.dm +++ b/code/modules/mob/living/silicon/pai/recruit.dm @@ -37,20 +37,39 @@ var/datum/paiController/paiController // Global handler for pAI candidates if(href_list["new"]) var/datum/paiCandidate/candidate = locate(href_list["candidate"]) var/option = href_list["option"] + var/t = "" + var/maxNameLen = 26 + switch(option) if("name") - candidate.name = input("Enter a name for your pAI", "pAI Name", candidate.name) as text + t = input("Enter a name for your pAI", "pAI Name", candidate.name) as text + if(t) + candidate.name = copytext(sanitize(t),1,maxNameLen) if("desc") - candidate.description = input("Enter a description for your pAI", "pAI Description", candidate.description) as message + t = input("Enter a description for your pAI", "pAI Description", candidate.description) as message + if(t) + candidate.description = copytext(sanitize(t),1,MAX_MESSAGE_LEN) if("role") - candidate.role = input("Enter a role for your pAI", "pAI Role", candidate.role) as text + t = input("Enter a role for your pAI", "pAI Role", candidate.role) as text + if(t) + candidate.role = copytext(sanitize(t),1,MAX_MESSAGE_LEN) if("ooc") - candidate.comments = input("Enter any OOC comments", "pAI OOC Comments", candidate.comments) as message - + t = input("Enter any OOC comments", "pAI OOC Comments", candidate.comments) as message + if(t) + candidate.comments = copytext(sanitize(t),1,MAX_MESSAGE_LEN) if("save") candidate.savefile_save(usr) if("load") candidate.savefile_load(usr) + //In case people have saved unsanitized stuff. + if(candidate.name) + candidate.name = copytext(sanitize(candidate.name),1,maxNameLen) + if(candidate.description) + candidate.description = copytext(sanitize(candidate.description),1,MAX_MESSAGE_LEN) + if(candidate.role) + candidate.role = copytext(sanitize(candidate.role),1,MAX_MESSAGE_LEN) + if(candidate.comments) + candidate.comments = copytext(sanitize(candidate.comments),1,MAX_MESSAGE_LEN) if("submit") if(candidate)