MODules don't create visual overlays when their required part isn't deployed (#87452)

## About The Pull Request
#86825 allowed MODsuits to only have a few of their parts deployed but
didn't change MODule overlay code, resulting in modules like welding
visor showing up even if you only have your gloves active.

## Why It's Good For The Game

Glitchy visuals begone.

## Changelog
🆑
fix: MODules don't create visual overlays when their required part isn't
deployed
/🆑

---------

Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com>
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
This commit is contained in:
SmArtKar
2024-10-27 22:01:45 +00:00
committed by GitHub
co-authored by Fikou LemonInTheDark
parent cd3fc8a67f
commit 7247928ec4
8 changed files with 74 additions and 20 deletions
+24
View File
@@ -475,6 +475,30 @@
wearer.update_spacesuit_hud_icon("0")
wearer = null
/obj/item/mod/control/proc/get_sealed_slots(list/parts)
var/covered_slots = NONE
for(var/obj/item/part as anything in parts)
if(!get_part_datum(part).sealed)
parts -= part
continue
covered_slots |= part.slot_flags
return covered_slots
/obj/item/mod/control/proc/generate_suit_mask()
var/list/parts = get_parts(all = TRUE)
var/covered_slots = get_sealed_slots(parts)
if(GLOB.mod_masks[skin])
if(GLOB.mod_masks[skin]["[covered_slots]"])
return GLOB.mod_masks[skin]["[covered_slots]"]
else
GLOB.mod_masks[skin] = list()
var/icon/slot_mask = icon('icons/blanks/32x32.dmi', "nothing")
for(var/obj/item/part as anything in parts)
slot_mask.Blend(icon(part.worn_icon, part.icon_state), ICON_OVERLAY)
slot_mask.Blend("#fff", ICON_ADD)
GLOB.mod_masks[skin]["[covered_slots]"] = slot_mask
return GLOB.mod_masks[skin]["[covered_slots]"]
/obj/item/mod/control/proc/clean_up()
if(QDELING(src))
unset_wearer()