From 62ce96e20eca6f101ec570ed985992cdfe449287 Mon Sep 17 00:00:00 2001 From: KorPhaeron Date: Wed, 24 Feb 2016 13:20:12 -0600 Subject: [PATCH] Adjacency checks --- code/game/objects/structures/mirror.dm | 17 +++++++++++++---- code/modules/ruins/lavaland_ruin_code.dm | 4 +--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm index f95dec2f6c5..0a85358629c 100644 --- a/code/game/objects/structures/mirror.dm +++ b/code/game/objects/structures/mirror.dm @@ -159,13 +159,17 @@ var/choice = input(user, "Something to change?", "Magical Grooming") as null|anything in list("name", "race", "gender", "hair", "eyes") + if(!Adjacent(user)) + return + switch(choice) if("name") var/newname = copytext(sanitize(input(H, "Who are we again?", "Name change", H.name) as null|text),1,MAX_NAME_LEN) if(!newname) return - + if(!Adjacent(user)) + return H.real_name = newname H.name = newname if(H.dna) @@ -180,7 +184,8 @@ if(!newrace) return - + if(!Adjacent(user)) + return H.set_species(newrace, icon_update=0) if(H.dna.species.use_skintones) @@ -209,7 +214,8 @@ if("gender") if(!(H.gender in list("male", "female"))) //blame the patriarchy return - + if(!Adjacent(user)) + return if(H.gender == "male") if(alert(H, "Become a Witch?", "Confirmation", "Yes", "No") == "Yes") H.gender = "female" @@ -229,7 +235,8 @@ if("hair") var/hairchoice = alert(H, "Hair style or hair color?", "Change Hair", "Style", "Color") - + if(!Adjacent(user)) + return if(hairchoice == "Style") //So you just want to use a mirror then? ..() else @@ -246,6 +253,8 @@ if("eyes") var/new_eye_color = input(H, "Choose your eye color", "Eye Color") as null|color + if(!Adjacent(user)) + return if(new_eye_color) H.eye_color = sanitize_hexcolor(new_eye_color) H.dna.update_ui_block(DNA_EYE_COLOR_BLOCK) diff --git a/code/modules/ruins/lavaland_ruin_code.dm b/code/modules/ruins/lavaland_ruin_code.dm index e54b4ddf1d2..da27f185975 100644 --- a/code/modules/ruins/lavaland_ruin_code.dm +++ b/code/modules/ruins/lavaland_ruin_code.dm @@ -42,8 +42,6 @@ return if(in_use) return - if(!ishuman(user)) - return in_use = TRUE user << "You feel your very life draining away as you pull the lever...it'll be worth it though, right?" user.adjustCloneLoss(20) @@ -85,7 +83,7 @@ //Pride -/obj/structure/mirror/magic +/obj/structure/mirror/magic/pride name = "pride's mirror" desc = "Pride cometh before the..." icon_state = "magic_mirror"