Skip to content

Commit

Permalink
bugfix: now hideheadseat for mask really hide headseats (#4519)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rerik007 authored Feb 29, 2024
1 parent 7af28d6 commit 9bb1eab
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 9 deletions.
4 changes: 2 additions & 2 deletions code/modules/clothing/masks/gasmask.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
desc = "A face-covering mask that can be connected to an air supply."
icon_state = "gas_alt"
flags = BLOCK_GAS_SMOKE_EFFECT | AIRTIGHT
flags_inv = HIDEHEADSETS|HIDEGLASSES|HIDENAME
flags_inv = HIDEGLASSES|HIDENAME
flags_cover = MASKCOVERSMOUTH | MASKCOVERSEYES
w_class = WEIGHT_CLASS_NORMAL
item_state = "gas_alt"
Expand Down Expand Up @@ -42,7 +42,7 @@
armor = list("melee" = 10, "bullet" = 0, "laser" = 0,"energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 55)
origin_tech = "materials=2;engineering=3"
actions_types = list(/datum/action/item_action/toggle)
flags_inv = HIDEHEADSETS|HIDEGLASSES|HIDENAME
flags_inv = HIDEGLASSES|HIDENAME
flags_cover = MASKCOVERSEYES|MASKCOVERSMOUTH
visor_flags_inv = HIDEGLASSES
resistance_flags = FIRE_PROOF
Expand Down
1 change: 1 addition & 0 deletions code/modules/mob/living/carbon/human/examine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
if(wear_mask)
skipface |= wear_mask.flags_inv & HIDENAME
skipeyes |= wear_mask.flags_inv & HIDEGLASSES
skipears |= wear_mask.flags_inv & HIDEHEADSETS

var/msg = "This is "

Expand Down
15 changes: 11 additions & 4 deletions code/modules/mob/living/carbon/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -684,10 +684,10 @@
if(do_mob(usr, src, POCKET_STRIP_DELAY/delay_denominator)) //placing an item into the pocket is 4 times faster
if(pocket_item)
if(pocket_item == (pocket_id == slot_r_store ? r_store : l_store)) //item still in the pocket we search
drop_item_ground(pocket_item)
if(thief_mode)
usr.put_in_hands(pocket_item)
add_attack_logs(usr, src, "Stripped of [pocket_item]")
if(drop_item_ground(pocket_item))
if(thief_mode)
usr.put_in_hands(pocket_item)
add_attack_logs(usr, src, "Stripped of [pocket_item]")
else
if(place_item)
usr.drop_item_ground(place_item)
Expand Down Expand Up @@ -1055,6 +1055,13 @@
obscured |= slot_r_ear
obscured |= slot_l_ear

if(wear_mask)
if(wear_mask.flags_inv & HIDEGLASSES)
obscured |= slot_glasses
if(wear_mask.flags_inv & HIDEHEADSETS)
obscured |= slot_r_ear
obscured |= slot_l_ear

if(obscured.len > 0)
return obscured
else
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/inventory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@
if(slot_glasses)
return head && (head.flags_inv & HIDEGLASSES) || wear_mask && (wear_mask.flags_inv & HIDEGLASSES)
if(slot_l_ear, slot_r_ear)
return head && (head.flags_inv & HIDEHEADSETS)
return head && (head.flags_inv & HIDEHEADSETS) || wear_mask && (wear_mask.flags_inv & HIDEHEADSETS)
else
return FALSE

Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/update_icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)

var/datum/sprite_accessory/hair/hair_style = GLOB.hair_styles_full_list[head_organ.h_style]
var/obj/item/clothing/glasses/G = glasses
if(head && !(head.flags_inv & MASKCOVERSEYES || head.flags_cover & HEADCOVERSEYES) && G.over_hat && istype(G))
if(head && !(head.flags_cover & HEADCOVERSEYES) && G.over_hat && istype(G))
new_glasses.layer = -OVER_HEAD_LAYER
overlays_standing[OVER_HEAD_LAYER] = new_glasses
apply_overlay(OVER_HEAD_LAYER)
Expand Down
3 changes: 2 additions & 1 deletion code/modules/mob/living/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,8 @@
what.add_fingerprint(src)
if(do_mob(src, who, what.strip_delay))
if(what && what == who.get_item_by_slot(where) && Adjacent(who))
who.drop_item_ground(what, silent = silent)
if(!who.drop_item_ground(what, silent = silent))
return
if(silent)
put_in_hands(what, silent = TRUE)
add_attack_logs(src, who, "Stripped of [what]")
Expand Down

0 comments on commit 9bb1eab

Please sign in to comment.