From 8240f1417620cbb2523bb20c75f417ff61380a4b Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Mon, 1 Dec 2014 23:55:03 +1030 Subject: [PATCH] Fixes #7185, works on #7184 --- code/modules/clothing/clothing.dm | 41 ++++++++++++-------- code/modules/clothing/spacesuits/rig/rig.dm | 27 ++++++++----- code/modules/mob/living/carbon/human/life.dm | 3 +- 3 files changed, 44 insertions(+), 27 deletions(-) diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index c6487cc9d2..d2d1f27e01 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -255,17 +255,36 @@ BLIND // can't see anything /obj/item/clothing/head/attack_self(mob/user) if(brightness_on) if(!isturf(user.loc)) - user << "You cannot turn the light on while in this [user.loc]" //To prevent some lighting anomalities. + user << "You cannot turn the light on while in this [user.loc]" return on = !on - update_icon() - if(on) - user.SetLuminosity(user.luminosity + brightness_on) - else - user.SetLuminosity(user.luminosity - brightness_on) + update_light(user) else return ..(user) +/obj/item/clothing/head/proc/update_light(var/mob/user = null) + if(on) + if(loc == user) + user.SetLuminosity(user.luminosity + brightness_on) + else if(isturf(loc)) + SetLuminosity(brightness_on) + else + if(loc == user) + user.SetLuminosity(user.luminosity - brightness_on) + else if(isturf(loc)) + SetLuminosity(0) + update_icon() + +/obj/item/clothing/head/pickup(mob/user) + if(on) + user.SetLuminosity(user.luminosity + brightness_on) + SetLuminosity(0) + +/obj/item/clothing/head/dropped(mob/user) + if(on) + user.SetLuminosity(user.luminosity - brightness_on) + SetLuminosity(brightness_on) + /obj/item/clothing/head/update_icon(var/mob/user) overlays.Cut() @@ -279,16 +298,6 @@ BLIND // can't see anything var/mob/living/carbon/human/H = user H.update_inv_head() -/obj/item/clothing/head/proc/update_light(mob/user) - - if(!brightness_on) - return - - if(on) - if(light_overlay) overlays |= light_overlay - user.SetLuminosity(user.luminosity - brightness_on) - SetLuminosity(brightness_on) - /obj/item/clothing/head/equipped(mob/user) ..() update_light(user) diff --git a/code/modules/clothing/spacesuits/rig/rig.dm b/code/modules/clothing/spacesuits/rig/rig.dm index 8e57f7eca1..e2850953bc 100644 --- a/code/modules/clothing/spacesuits/rig/rig.dm +++ b/code/modules/clothing/spacesuits/rig/rig.dm @@ -69,6 +69,7 @@ var/offline_slowdown = 10 // If the suit is deployed and unpowered, it sets slowdown to this. var/vision_restriction var/offline_vision_restriction = 1 // 0 - none, 1 - welder vision, 2 - blind. Maybe move this to helmets. + var/list/suit_can_hold // Wiring! How exciting. var/datum/wires/rig/wires @@ -122,6 +123,10 @@ verbs |= /obj/item/weapon/rig/proc/toggle_boots if(chest_type) chest = new chest_type(src) + if(suit_can_hold) + chest.allowed = suit_can_hold + else + chest.allowed = list() verbs |= /obj/item/weapon/rig/proc/toggle_chest for(var/obj/item/piece in list(gloves,helmet,boots,chest)) @@ -235,15 +240,17 @@ if("helmet") M << "\The [piece] hisses [!seal_target ? "closed" : "open"]." M.update_inv_head() - if(!seal_target) - if(flags & AIRTIGHT) - helmet.flags |= AIRTIGHT - helmet.flags_inv |= (HIDEEYES|HIDEFACE) - helmet.body_parts_covered |= (FACE|EYES) - else - helmet.flags &= ~AIRTIGHT - helmet.flags_inv &= ~(HIDEEYES|HIDEFACE) - helmet.body_parts_covered &= ~(FACE|EYES) + if(helmet) + if(!seal_target) + if(flags & AIRTIGHT) + helmet.flags |= AIRTIGHT + helmet.flags_inv |= (HIDEEYES|HIDEFACE) + helmet.body_parts_covered |= (FACE|EYES) + else + helmet.flags &= ~AIRTIGHT + helmet.flags_inv &= ~(HIDEEYES|HIDEFACE) + helmet.body_parts_covered &= ~(FACE|EYES) + helmet.update_light(wearer) else failed_to_seal = 1 @@ -480,7 +487,7 @@ if((istype(H) && H.back == src) || (istype(H,/mob/living/silicon))) if(istype(H,/mob/living/silicon)) - if(!control_overridden) + if(!ai_override_enabled) usr << "Synthetic access disabled. Please consult hardware provider." return else if(security_check_enabled && !src.allowed(usr)) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index ddb44f3a1b..69890e58a8 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1245,7 +1245,8 @@ if(copytext(hud.icon_state,1,4) == "hud") //ugly, but icon comparison is worse, I believe client.images.Remove(hud) - client.screen -= global_huds + for(var/hud in global_huds) + client.screen.Remove(hud) update_action_buttons()