diff --git a/code/game/objects/structures/crates_lockers/closets/job_closets.dm b/code/game/objects/structures/crates_lockers/closets/job_closets.dm
index 1f0a3386f4e..4ac722a6719 100644
--- a/code/game/objects/structures/crates_lockers/closets/job_closets.dm
+++ b/code/game/objects/structures/crates_lockers/closets/job_closets.dm
@@ -188,9 +188,6 @@
new /obj/item/clothing/shoes/sneakers/black(src)
new /obj/item/clothing/shoes/sneakers/black(src)
new /obj/item/clothing/shoes/sneakers/black(src)
- new /obj/item/clothing/head/hardhat/atmos(src)
- new /obj/item/clothing/head/hardhat/atmos(src)
- new /obj/item/clothing/head/hardhat/atmos(src)
return
/obj/structure/closet/wardrobe/engineering_yellow
diff --git a/code/game/objects/structures/crates_lockers/closets/secure/engineering.dm b/code/game/objects/structures/crates_lockers/closets/secure/engineering.dm
index c03090a5119..a37b474470c 100644
--- a/code/game/objects/structures/crates_lockers/closets/secure/engineering.dm
+++ b/code/game/objects/structures/crates_lockers/closets/secure/engineering.dm
@@ -89,4 +89,5 @@
new /obj/item/tapeproj/engineering(src)
new /obj/item/weapon/watertank/atmos(src)
new /obj/item/clothing/suit/fire/atmos(src)
+ new /obj/item/clothing/head/hardhat/atmos(src)
new /obj/item/clothing/glasses/meson/engine/tray(src)
\ No newline at end of file
diff --git a/code/modules/clothing/head/hardhat.dm b/code/modules/clothing/head/hardhat.dm
index 16d33da43c8..ef82c5ce6be 100644
--- a/code/modules/clothing/head/hardhat.dm
+++ b/code/modules/clothing/head/hardhat.dm
@@ -73,7 +73,7 @@
item_color = "atmos"
name = "atmospheric technician's firefighting helmet"
desc = "A firefighter's helmet, able to keep the user cool in any situation."
- flags = STOPSPRESSUREDMAGE
+ flags = BLOCKHAIR | STOPSPRESSUREDMAGE | THICKMATERIAL
flags_inv = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE
heat_protection = HEAD
max_heat_protection_temperature = FIRE_IMMUNITY_HELM_MAX_TEMP_PROTECT
diff --git a/code/modules/clothing/head/helmet.dm b/code/modules/clothing/head/helmet.dm
index 5f6e75ad7d9..99940b9a6ad 100644
--- a/code/modules/clothing/head/helmet.dm
+++ b/code/modules/clothing/head/helmet.dm
@@ -231,7 +231,9 @@
if(!F)
return
- var/mob/living/carbon/human/user = usr
+ var/mob/user = usr
+ if(user.incapacitated())
+ return
if(!isturf(user.loc))
user << "You cannot turn the light on while in this [user.loc]!"
F.on = !F.on
diff --git a/code/modules/clothing/spacesuits/miscellaneous.dm b/code/modules/clothing/spacesuits/miscellaneous.dm
index 5380c3a54c7..0fe9492913c 100644
--- a/code/modules/clothing/spacesuits/miscellaneous.dm
+++ b/code/modules/clothing/spacesuits/miscellaneous.dm
@@ -226,7 +226,6 @@ Contains:
item_state = "space"
desc = "A lightweight space helmet with the basic ability to protect the wearer from the vacuum of space during emergencies."
flash_protect = 0
- flags_inv = HIDEMASK|HIDEEARS|HIDEEYES
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 100, rad = 20)
/obj/item/clothing/head/helmet/space/freedom
diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm
index 5968b88647e..ce5bf0c35ab 100644
--- a/code/modules/mob/living/carbon/human/inventory.dm
+++ b/code/modules/mob/living/carbon/human/inventory.dm
@@ -85,12 +85,56 @@
return null
+//This is an UNSAFE proc. Use mob_can_equip() before calling this one! Or rather use equip_to_slot_if_possible() or advanced_equip_to_slot_if_possible()
+/mob/living/carbon/human/equip_to_slot(obj/item/I, slot)
+ if(!..()) //a check failed or the item has already found its slot
+ return
+ switch(slot)
+ if(slot_belt)
+ belt = I
+ update_inv_belt()
+ if(slot_wear_id)
+ wear_id = I
+ sec_hud_set_ID()
+ update_inv_wear_id()
+ if(slot_ears)
+ ears = I
+ update_inv_ears()
+ if(slot_glasses)
+ glasses = I
+ update_inv_glasses()
+ if(slot_gloves)
+ gloves = I
+ update_inv_gloves()
+ if(slot_shoes)
+ shoes = I
+ update_inv_shoes()
+ if(slot_wear_suit)
+ wear_suit = I
+ if(I.flags_inv & HIDEJUMPSUIT)
+ update_inv_w_uniform()
+ update_inv_wear_suit()
+ if(slot_w_uniform)
+ w_uniform = I
+ update_suit_sensors()
+ update_inv_w_uniform()
+ if(slot_l_store)
+ l_store = I
+ update_inv_pockets()
+ if(slot_r_store)
+ r_store = I
+ update_inv_pockets()
+ if(slot_s_store)
+ s_store = I
+ update_inv_s_store()
+ else
+ src << "You are trying to equip this item to an unsupported inventory slot. Report this to a coder!"
+
/mob/living/carbon/human/unEquip(obj/item/I)
. = ..() //See mob.dm for an explanation on this and some rage about people copypasting instead of calling ..() like they should.
if(!. || !I)
return
-
if(I == wear_suit)
if(s_store)
unEquip(s_store, 1) //It makes no sense for your suit storage to stay on you if you drop your suit.
@@ -125,16 +169,6 @@
else if(I == belt)
belt = null
update_inv_belt()
- else if(I == wear_mask)
- wear_mask = null
- if(I.flags & BLOCKHAIR)
- update_hair() //rebuild hair
- if(internal)
- if(internals)
- internals.icon_state = "internal0"
- internal = null
- sec_hud_set_ID()
- update_inv_wear_mask()
else if(I == wear_id)
wear_id = null
sec_hud_set_ID()
@@ -149,95 +183,27 @@
s_store = null
update_inv_s_store()
-//This is an UNSAFE proc. Use mob_can_equip() before calling this one! Or rather use equip_to_slot_if_possible() or advanced_equip_to_slot_if_possible()
-//set redraw_mob to 0 if you don't wish the hud to be updated - if you're doing it manually in your own proc.
-/mob/living/carbon/human/equip_to_slot(obj/item/I, slot, redraw_mob = 1)
- if(!slot) return
- if(!istype(I)) return
+/mob/living/carbon/human/wear_mask_update(obj/item/I, unequip = 1)
+ if(I.flags & BLOCKHAIR)
+ update_hair()
+ if(unequip && internal)
+ if(internals)
+ internals.icon_state = "internal0"
+ internal = null
+ sec_hud_set_ID()
+ ..()
+
+/mob/living/carbon/human/head_update(obj/item/I)
+ if(I.flags & BLOCKHAIR)
+ update_hair()
+ if(I.flags_inv & HIDEEYES)
+ update_inv_glasses()
+ if(I.flags_inv & HIDEEARS)
+ update_body()
+ ..()
- if(I == l_hand)
- l_hand = null
- else if(I == r_hand)
- r_hand = null
- I.screen_loc = null // will get moved if inventory is visible
- I.loc = src
- I.equipped(src, slot)
- I.layer = 20
- switch(slot)
- if(slot_back)
- back = I
- update_inv_back(redraw_mob)
- if(slot_wear_mask)
- wear_mask = I
- if(wear_mask.flags & BLOCKHAIR)
- update_hair(redraw_mob) //rebuild hair
- sec_hud_set_ID()
- update_inv_wear_mask(redraw_mob)
- if(slot_handcuffed)
- handcuffed = I
- update_inv_handcuffed(redraw_mob)
- if(slot_legcuffed)
- legcuffed = I
- update_inv_legcuffed(redraw_mob)
- if(slot_l_hand)
- l_hand = I
- update_inv_l_hand(redraw_mob)
- if(slot_r_hand)
- r_hand = I
- update_inv_r_hand(redraw_mob)
- if(slot_belt)
- belt = I
- update_inv_belt(redraw_mob)
- if(slot_wear_id)
- wear_id = I
- sec_hud_set_ID()
- update_inv_wear_id(redraw_mob)
- if(slot_ears)
- ears = I
- update_inv_ears(redraw_mob)
- if(slot_glasses)
- glasses = I
- update_inv_glasses(redraw_mob)
- if(slot_gloves)
- gloves = I
- update_inv_gloves(redraw_mob)
- if(slot_head)
- head = I
- if(head.flags & BLOCKHAIR)
- update_hair(redraw_mob) //rebuild hair
- if(head.flags_inv & HIDEEARS)
- update_body(redraw_mob)
- update_inv_head(redraw_mob)
- if(slot_shoes)
- shoes = I
- update_inv_shoes(redraw_mob)
- if(slot_wear_suit)
- wear_suit = I
- if(I.flags_inv & HIDEJUMPSUIT)
- update_inv_w_uniform()
- update_inv_wear_suit(redraw_mob)
- if(slot_w_uniform)
- w_uniform = I
- update_suit_sensors()
- update_inv_w_uniform(redraw_mob)
- if(slot_l_store)
- l_store = I
- update_inv_pockets(redraw_mob)
- if(slot_r_store)
- r_store = I
- update_inv_pockets(redraw_mob)
- if(slot_s_store)
- s_store = I
- update_inv_s_store(redraw_mob)
- if(slot_in_backpack)
- if(get_active_hand() == I)
- unEquip(I)
- I.loc = back
- else
- src << "You are trying to equip this item to an unsupported inventory slot. Report this to a coder!"
- return
//Cycles through all clothing slots and tests them for destruction
/mob/living/carbon/human/proc/shred_clothing(bomb,shock)
diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm
index f9973ea991d..340637b62bb 100644
--- a/code/modules/mob/living/carbon/human/species.dm
+++ b/code/modules/mob/living/carbon/human/species.dm
@@ -308,7 +308,7 @@
bodyparts_to_add -= "waggingspines"
if("snout" in mutant_bodyparts) //Take a closer look at that snout!
- if(H.wear_mask && (H.wear_mask.flags_inv & HIDEFACE))
+ if((H.wear_mask && (H.wear_mask.flags_inv & HIDEFACE)) || (H.head && (H.head.flags_inv & HIDEFACE)))
bodyparts_to_add -= "snout"
if("frills" in mutant_bodyparts)
diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm
index 1b3da71d25d..b2230ae11eb 100644
--- a/code/modules/mob/living/carbon/human/update_icons.dm
+++ b/code/modules/mob/living/carbon/human/update_icons.dm
@@ -275,19 +275,20 @@ Please contact me on #coderbus IRC. ~Carnie x
glasses.screen_loc = ui_glasses //...draw the item in the inventory screen
client.screen += glasses //Either way, add the item to the HUD
- var/layer2use
- if(glasses.alternate_worn_layer)
- layer2use = glasses.alternate_worn_layer
- if(!layer2use)
- layer2use = GLASSES_LAYER
+ if(!(head && (head.flags_inv & HIDEEYES)))
+ var/layer2use
+ if(glasses.alternate_worn_layer)
+ layer2use = glasses.alternate_worn_layer
+ if(!layer2use)
+ layer2use = GLASSES_LAYER
- var/image/standing
- if(glasses.alternate_worn_icon)
- standing = image("icon"=glasses.alternate_worn_icon, "icon_state"="[glasses.icon_state]","layer"=-layer2use)
- if(!standing)
- standing = image("icon"='icons/mob/eyes.dmi', "icon_state"="[glasses.icon_state]", "layer"=-layer2use)
+ var/image/standing
+ if(glasses.alternate_worn_icon)
+ standing = image("icon"=glasses.alternate_worn_icon, "icon_state"="[glasses.icon_state]","layer"=-layer2use)
+ if(!standing)
+ standing = image("icon"='icons/mob/eyes.dmi', "icon_state"="[glasses.icon_state]", "layer"=-layer2use)
- overlays_standing[GLASSES_LAYER] = standing
+ overlays_standing[GLASSES_LAYER] = standing
apply_overlay(GLASSES_LAYER)
diff --git a/code/modules/mob/living/carbon/inventory.dm b/code/modules/mob/living/carbon/inventory.dm
index 44ba92c73f2..d397a7af712 100644
--- a/code/modules/mob/living/carbon/inventory.dm
+++ b/code/modules/mob/living/carbon/inventory.dm
@@ -17,24 +17,67 @@
return null
-/mob/living/carbon/unEquip(obj/item/I) //THIS PROC DID NOT CALL ..() AND THAT COST ME AN ENTIRE DAY OF DEBUGGING.
+//This is an UNSAFE proc. Use mob_can_equip() before calling this one! Or rather use equip_to_slot_if_possible() or advanced_equip_to_slot_if_possible()
+/mob/living/carbon/equip_to_slot(obj/item/I, slot)
+ if(!slot)
+ return
+ if(!istype(I))
+ return
+
+ if(I == l_hand)
+ l_hand = null
+ else if(I == r_hand)
+ r_hand = null
+
+ I.screen_loc = null // will get moved if inventory is visible
+ I.loc = src
+ I.equipped(src, slot)
+ I.layer = 20
+
+ switch(slot)
+ if(slot_back)
+ back = I
+ update_inv_back()
+ if(slot_wear_mask)
+ wear_mask = I
+ wear_mask_update(I, unequip=0)
+ if(slot_head)
+ head = I
+ head_update(I)
+ if(slot_handcuffed)
+ handcuffed = I
+ update_inv_handcuffed()
+ if(slot_legcuffed)
+ legcuffed = I
+ update_inv_legcuffed()
+ if(slot_l_hand)
+ l_hand = I
+ update_inv_l_hand()
+ if(slot_r_hand)
+ r_hand = I
+ update_inv_r_hand()
+ if(slot_in_backpack)
+ if(I == get_active_hand())
+ unEquip(I)
+ I.loc = back
+ else
+ return 1
+
+
+/mob/living/carbon/unEquip(obj/item/I)
. = ..() //Sets the default return value to what the parent returns.
if(!. || !I) //We don't want to set anything to null if the parent returned 0.
return
if(I == head)
head = null
- if(I.flags & BLOCKHAIR)
- update_hair()
- update_inv_head()
+ head_update(I)
else if(I == back)
back = null
update_inv_back()
else if(I == wear_mask)
- if(istype(src, /mob/living/carbon/human)) //If we don't do this hair won't be properly rebuilt.
- return
wear_mask = null
- update_inv_wear_mask()
+ wear_mask_update(I, unequip=1)
else if(I == handcuffed)
handcuffed = null
if(buckled && buckled.buckle_requires_restraints)
@@ -44,3 +87,12 @@
legcuffed = null
update_inv_legcuffed()
+//handle stuff to update when a mob equips/unequips a mask.
+/mob/living/carbon/proc/wear_mask_update(obj/item/I, unequip = 1)
+ update_inv_wear_mask()
+
+//handle stuff to update when a mob equips/unequips a headgear.
+/mob/living/carbon/proc/head_update(obj/item/I)
+ if(I.flags_inv & HIDEMASK)
+ update_inv_wear_mask()
+ update_inv_head()
diff --git a/code/modules/mob/living/carbon/monkey/inventory.dm b/code/modules/mob/living/carbon/monkey/inventory.dm
index c0ae3e21920..0d7378a729c 100644
--- a/code/modules/mob/living/carbon/monkey/inventory.dm
+++ b/code/modules/mob/living/carbon/monkey/inventory.dm
@@ -29,57 +29,4 @@
return 0 //Unsupported slot
-//This is an UNSAFE proc. Use mob_can_equip() before calling this one! Or rather use equip_to_slot_if_possible() or advanced_equip_to_slot_if_possible()
-//set redraw_mob to 0 if you don't wish the hud to be updated - if you're doing it manually in your own proc.
-/mob/living/carbon/monkey/equip_to_slot(obj/item/I, slot, redraw_mob = 1)
- if(!slot) return
- if(!istype(I)) return
-
- if(I == l_hand)
- l_hand = null
- else if(I == r_hand)
- r_hand = null
-
- switch(slot)
- if(slot_back)
- back = I
- I.equipped(src, slot)
- update_inv_back(redraw_mob)
- if(slot_wear_mask)
- wear_mask = I
- I.equipped(src, slot)
- update_inv_wear_mask(redraw_mob)
- if(slot_head)
- head = I
- I.equipped(src, slot)
- update_inv_head(redraw_mob)
- if(slot_handcuffed)
- handcuffed = I
- update_inv_handcuffed(redraw_mob)
- if(slot_legcuffed)
- legcuffed = I
- I.equipped(src, slot)
- update_inv_legcuffed(redraw_mob)
- if(slot_l_hand)
- l_hand = I
- I.equipped(src, slot)
- update_inv_l_hand(redraw_mob)
- if(slot_r_hand)
- r_hand = I
- I.equipped(src, slot)
- update_inv_r_hand(redraw_mob)
- if(slot_in_backpack)
- if(I == get_active_hand())
- unEquip(I)
- I.loc = back
- return
- else
- usr << "You are trying to equip this item to an unsupported inventory slot. Report this to a coder."
- return
-
- I.loc = src
- I.equipped(src, slot)
- I.layer = 20
-
-
diff --git a/code/modules/mob/living/carbon/update_icons.dm b/code/modules/mob/living/carbon/update_icons.dm
index b0563bb2d38..7c6c62f0fb0 100644
--- a/code/modules/mob/living/carbon/update_icons.dm
+++ b/code/modules/mob/living/carbon/update_icons.dm
@@ -101,24 +101,26 @@
/mob/living/carbon/update_inv_wear_mask()
remove_overlay(FACEMASK_LAYER)
+
if(istype(wear_mask, /obj/item/clothing/mask))
- var/layer2use
- if(wear_mask.alternate_worn_layer)
- layer2use = wear_mask.alternate_worn_layer
- if(!layer2use)
- layer2use = FACEMASK_LAYER
+ if(!(head && (head.flags_inv & HIDEMASK)))
+ var/layer2use
+ if(wear_mask.alternate_worn_layer)
+ layer2use = wear_mask.alternate_worn_layer
+ if(!layer2use)
+ layer2use = FACEMASK_LAYER
- var/image/standing
- if(wear_mask.alternate_worn_icon)
- standing = image("icon"=wear_mask.alternate_worn_icon, "icon_state"="[wear_mask.icon_state]", "layer"=-layer2use)
- if(!standing)
- standing = image("icon"='icons/mob/mask.dmi', "icon_state"="[wear_mask.icon_state]", "layer"=-layer2use)
+ var/image/standing
+ if(wear_mask.alternate_worn_icon)
+ standing = image("icon"=wear_mask.alternate_worn_icon, "icon_state"="[wear_mask.icon_state]", "layer"=-layer2use)
+ if(!standing)
+ standing = image("icon"='icons/mob/mask.dmi', "icon_state"="[wear_mask.icon_state]", "layer"=-layer2use)
- overlays_standing[FACEMASK_LAYER] = standing
+ overlays_standing[FACEMASK_LAYER] = standing
- if(wear_mask.blood_DNA && (wear_mask.body_parts_covered & HEAD))
- standing.overlays += image("icon"='icons/effects/blood.dmi', "icon_state"="maskblood")
+ if(wear_mask.blood_DNA && (wear_mask.body_parts_covered & HEAD))
+ standing.overlays += image("icon"='icons/effects/blood.dmi', "icon_state"="maskblood")
return wear_mask
/mob/living/carbon/update_inv_back()
diff --git a/icons/mob/animal.dmi b/icons/mob/animal.dmi
index f19763f9df8..93856d3e80d 100644
Binary files a/icons/mob/animal.dmi and b/icons/mob/animal.dmi differ
diff --git a/icons/mob/head.dmi b/icons/mob/head.dmi
index b7d661d1058..38620894fa4 100644
Binary files a/icons/mob/head.dmi and b/icons/mob/head.dmi differ
diff --git a/icons/mob/suit.dmi b/icons/mob/suit.dmi
index 54d92a17ba1..9dc96f78dd2 100644
Binary files a/icons/mob/suit.dmi and b/icons/mob/suit.dmi differ
diff --git a/tgstation.dme b/tgstation.dme
index 2bf744c774b..d4344bc7986 100644
--- a/tgstation.dme
+++ b/tgstation.dme
@@ -1183,6 +1183,7 @@
#include "code\modules\mob\living\carbon\brain\death.dm"
#include "code\modules\mob\living\carbon\brain\emote.dm"
#include "code\modules\mob\living\carbon\brain\life.dm"
+#include "code\modules\mob\living\carbon\brain\login.dm"
#include "code\modules\mob\living\carbon\brain\MMI.dm"
#include "code\modules\mob\living\carbon\brain\posibrain.dm"
#include "code\modules\mob\living\carbon\brain\say.dm"