diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index cfb3cd14c7c..85a664ad9fd 100755 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -849,7 +849,9 @@ var/global/list/obj/item/device/pda/PDAs = list() /obj/item/device/pda/proc/create_message(var/mob/living/U = usr, var/obj/item/device/pda/P) - var/t = input(U, "Please enter message", name, null) as text + var/t = input(U, "Please enter message", name, null) as text|null + if(!t) + return t = sanitize(copytext(t, 1, MAX_MESSAGE_LEN)) t = readd_quotes(t) if (!t || !istype(P)) diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index eac013eb8b1..4d572377700 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -26,11 +26,12 @@ /mob/living/silicon/robot/proc/use_power() if (is_component_functioning("power cell") && cell) - for(var/obj/item/borg/B in module.modules) - if(B.powerneeded) - if((cell.charge * 100 / cell.maxcharge) < B.powerneeded) - src << "Deactivating [B.name] due to lack of power!" - unEquip(B) + if(module) + for(var/obj/item/borg/B in module.modules) + if(B.powerneeded) + if((cell.charge * 100 / cell.maxcharge) < B.powerneeded) + src << "Deactivating [B.name] due to lack of power!" + unEquip(B) if(src.cell.charge <= 0) uneq_all() update_headlamp(1) diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index ce0e238fb31..06bd83ed96f 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -224,7 +224,9 @@ var/list/robot_verbs_default = list( modules = list("Peacekeeper") if(mmi != null && mmi.alien) modules = "Hunter" - modtype = input("Please, select a module!", "Robot", null, null) in modules + modtype = input("Please, select a module!", "Robot", null, null) as null|anything in modules + if(!modtype) + return designation = modtype var/module_sprites[0] //Used to store the associations between sprite names and sprite index. diff --git a/code/modules/reagents/Chemistry-Machinery.dm b/code/modules/reagents/Chemistry-Machinery.dm index 55ba20e3880..7f090a72be6 100644 --- a/code/modules/reagents/Chemistry-Machinery.dm +++ b/code/modules/reagents/Chemistry-Machinery.dm @@ -569,12 +569,19 @@ else if (href_list["createpill"] || href_list["createpill_multiple"]) if(!condi) var/count = 1 - if (href_list["createpill_multiple"]) count = isgoodnumber(input("Select the number of pills to make.", 10, pillamount) as num) + if (href_list["createpill_multiple"]) + count = input("Select the number of pills to make.", 10, pillamount) as num|null + if(count == null) + return + count = isgoodnumber(count) if (count > 20) count = 20 //Pevent people from creating huge stacks of pills easily. Maybe move the number to defines? if (count <= 0) return var/amount_per_pill = reagents.total_volume/count if (amount_per_pill > 50) amount_per_pill = 50 - var/name = reject_bad_text(input(usr,"Name:","Name your pill!","[reagents.get_master_reagent_name()] ([amount_per_pill] units)")) + var/name = input(usr,"Name:","Name your pill!","[reagents.get_master_reagent_name()] ([amount_per_pill] units)") as text|null + if(!name) + return + name = reject_bad_text(name) while (count--) var/obj/item/weapon/reagent_containers/pill/P = new/obj/item/weapon/reagent_containers/pill(src.loc) if(!name) name = reagents.get_master_reagent_name() @@ -588,7 +595,10 @@ P.forceMove(loaded_pill_bottle) src.updateUsrDialog() else - var/name = reject_bad_text(input(usr,"Name:","Name your bag!",reagents.get_master_reagent_name())) + var/name = input(usr,"Name:","Name your bag!",reagents.get_master_reagent_name()) as text|null + if(!name) + return + name = reject_bad_text(name) var/obj/item/weapon/reagent_containers/food/condiment/pack/P = new/obj/item/weapon/reagent_containers/food/condiment/pack(src.loc) if(!name) name = reagents.get_master_reagent_name() P.originalname = name @@ -598,13 +608,20 @@ else if (href_list["createpatch"] || href_list["createpatch_multiple"]) if(!condi) var/count = 1 - if (href_list["createpatch_multiple"]) count = isgoodnumber(input("Select the number of patches to make.", 10, patchamount) as num) + if (href_list["createpatch_multiple"]) + count = input("Select the number of patches to make.", 10, patchamount) as num|null + if(count == null) + return + count = isgoodnumber(count) if(!count || count <= 0) return if (count > 20) count = 20 //Pevent people from creating huge stacks of patches easily. Maybe move the number to defines? var/amount_per_patch = reagents.total_volume/count if (amount_per_patch > 40) amount_per_patch = 40 - var/name = reject_bad_text(input(usr,"Name:","Name your patch!","[reagents.get_master_reagent_name()] ([amount_per_patch] units)")) + var/name = input(usr,"Name:","Name your patch!","[reagents.get_master_reagent_name()] ([amount_per_patch] units)") as text|null + if(!name) + return + name = reject_bad_text(name) while (count--) var/obj/item/weapon/reagent_containers/pill/patch/P = new/obj/item/weapon/reagent_containers/pill/patch(src.loc) if(!name) name = reagents.get_master_reagent_name() @@ -614,7 +631,10 @@ reagents.trans_to(P,amount_per_patch) else if (href_list["createbottle"]) if(!condi) - var/name = reject_bad_text(input(usr,"Name:","Name your bottle!",reagents.get_master_reagent_name())) + var/name = input(usr,"Name:","Name your bottle!",reagents.get_master_reagent_name()) as text|null + if(!name) + return + name = reject_bad_text(name) var/obj/item/weapon/reagent_containers/glass/bottle/P = new/obj/item/weapon/reagent_containers/glass/bottle(src.loc) if(!name) name = reagents.get_master_reagent_name() P.name = "[name] bottle"