Files
MrMelbertandGitHub 64ff083c39 Fix held item slowdowns (#92910)
## About The Pull Request

Fixes #92907 

Missed a place where it's called manually

Fixes #92915
Fixes #92928

Hair masks relied on `update_obscured` calling `update_body`

## Changelog

🆑 Melbert
fix: Fix held items with slowdown not working
fix: Fix hair mask updating oddly
/🆑
2025-09-10 23:12:08 +02:00

81 lines
2.1 KiB
Plaintext

// Drone inventory procs
/mob/living/basic/drone/doUnEquip(obj/item/item_dropping, force, newloc, no_move, invdrop = TRUE, silent = FALSE)
if(..())
update_held_items()
if(item_dropping == head)
head = null
update_worn_head()
if(item_dropping == internal_storage)
internal_storage = null
update_inv_internal_storage()
return TRUE
return FALSE
/mob/living/basic/drone/can_equip(obj/item/item, slot, disable_warning = FALSE, bypass_equip_delay_self = FALSE, ignore_equipped = FALSE, indirect_action = FALSE)
switch(slot)
if(ITEM_SLOT_HEAD)
if(head)
return FALSE
if(!((item.slot_flags & ITEM_SLOT_HEAD) || (item.slot_flags & ITEM_SLOT_MASK)))
return FALSE
return TRUE
if(ITEM_SLOT_DEX_STORAGE)
if(internal_storage)
return FALSE
return TRUE
..()
/mob/living/basic/drone/get_item_by_slot(slot_id)
switch(slot_id)
if(ITEM_SLOT_HEAD)
return head
if(ITEM_SLOT_DEX_STORAGE)
return internal_storage
return ..()
/mob/living/basic/drone/get_slot_by_item(obj/item/looking_for)
if(internal_storage == looking_for)
return ITEM_SLOT_DEX_STORAGE
if(head == looking_for)
return ITEM_SLOT_HEAD
return ..()
/mob/living/basic/drone/equip_to_slot(obj/item/equipping, slot, initial = FALSE, redraw_mob = FALSE, indirect_action = FALSE)
if(!slot)
return
if(!istype(equipping))
return
var/index = get_held_index_of_item(equipping)
if(index)
held_items[index] = null
update_held_items()
if(equipping.pulledby)
equipping.pulledby.stop_pulling()
equipping.screen_loc = null // will get moved if inventory is visible
equipping.forceMove(src)
SET_PLANE_EXPLICIT(equipping, ABOVE_HUD_PLANE, src)
switch(slot)
if(ITEM_SLOT_HEAD)
head = equipping
update_worn_head()
if(ITEM_SLOT_DEX_STORAGE)
internal_storage = equipping
update_inv_internal_storage()
else
to_chat(src, span_danger("You are trying to equip this item to an unsupported inventory slot. Report this to a coder!"))
return
//Call back for item being equipped to drone
has_equipped(equipping, slot)
/mob/living/basic/drone/getBackSlot()
return ITEM_SLOT_DEX_STORAGE