[MIRROR] Dummies equipping outfits no longer call equipped (#5140)

* Dummies equipping outfits no longer call equipped (#58597)

* Dummies equipping outfits no longer call equipped

Co-authored-by: Trigg <36010999+TriggeredBoi@users.noreply.github.com>
This commit is contained in:
SkyratBot
2021-04-24 00:22:56 +01:00
committed by GitHub
co-authored by Trigg
parent 7db320f600
commit 2d4b83f6d4
11 changed files with 38 additions and 17 deletions
+11
View File
@@ -488,6 +488,16 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb
/obj/item/proc/on_found(mob/finder)
return
/**
* To be overwritten to only perform visual tasks;
* this is directly called instead of `equipped` on visual-only features like human dummies equipping outfits.
*
* This separation exists to prevent things like the monkey sentience helmet from
* polling ghosts while it's just being equipped as a visual preview for a dummy.
*/
/obj/item/proc/visual_equipped(mob/user, slot, initial = FALSE)
return
/**
* Called after an item is placed in an equipment slot.
*
@@ -500,6 +510,7 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb
*/
/obj/item/proc/equipped(mob/user, slot, initial = FALSE)
SHOULD_CALL_PARENT(TRUE)
visual_equipped(user, slot, initial)
SEND_SIGNAL(src, COMSIG_ITEM_EQUIPPED, user, slot)
for(var/X in actions)
var/datum/action/A = X
+1 -1
View File
@@ -339,7 +339,7 @@
inhand_icon_state = "blindfoldwhite"
var/colored_before = FALSE
/obj/item/clothing/glasses/blindfold/white/equipped(mob/living/carbon/human/user, slot)
/obj/item/clothing/glasses/blindfold/white/visual_equipped(mob/living/carbon/human/user, slot)
if(ishuman(user) && slot == ITEM_SLOT_EYES)
update_icon(ALL, user)
user.update_inv_glasses() //Color might have been changed by update_icon.
-2
View File
@@ -420,8 +420,6 @@
. = ..()
if(slot != ITEM_SLOT_HEAD)
return
if(istype(user, /mob/living/carbon/human/dummy)) //Prevents ghosts from being polled when the helmet is put on a dummy.
return
if(!ismonkey(user) || user.ckey)
var/mob/living/something = user
to_chat(something, "<span class='boldnotice'>You feel a stabbing pain in the back of your head for a moment.</span>")
+2 -2
View File
@@ -165,7 +165,7 @@
dog_fashion = /datum/dog_fashion/head/kitty
/obj/item/clothing/head/kitty/equipped(mob/living/carbon/human/user, slot)
/obj/item/clothing/head/kitty/visual_equipped(mob/living/carbon/human/user, slot)
if(ishuman(user) && slot == ITEM_SLOT_HEAD)
update_icon(ALL, user)
user.update_inv_head() //Color might have been changed by update_appearance.
@@ -294,7 +294,7 @@
hairstyle = pick(GLOB.hairstyles_list - "Bald")
. = ..()
/obj/item/clothing/head/wig/natural/equipped(mob/living/carbon/human/user, slot)
/obj/item/clothing/head/wig/natural/visual_equipped(mob/living/carbon/human/user, slot)
. = ..()
if(ishuman(user) && slot == ITEM_SLOT_HEAD)
if (color != "#[user.hair_color]") // only update if necessary
+5 -2
View File
@@ -63,13 +63,16 @@
else if(tied == SHOES_KNOTTED)
. += "The shoelaces are all knotted together."
/obj/item/clothing/shoes/equipped(mob/user, slot)
. = ..()
/obj/item/clothing/shoes/visual_equipped(mob/user, slot)
..()
if(offset && (slot_flags & slot))
user.pixel_y += offset
worn_y_dimension -= (offset * 2)
user.update_inv_shoes()
equipped_before_drop = TRUE
/obj/item/clothing/shoes/equipped(mob/user, slot)
. = ..()
if(can_be_tied && tied == SHOES_UNTIED)
our_alert = user.throw_alert("shoealert", /atom/movable/screen/alert/shoes/untied)
RegisterSignal(src, COMSIG_SHOES_STEP_ACTION, .proc/check_trip, override=TRUE)
@@ -225,12 +225,12 @@
/obj/item/clothing/suit/armor/reactive/tesla/dropped(mob/user)
..()
if(istype(user))
ADD_TRAIT(user, TRAIT_TESLA_SHOCKIMMUNE, "reactive_tesla_armor")
REMOVE_TRAIT(user, TRAIT_TESLA_SHOCKIMMUNE, "reactive_tesla_armor")
/obj/item/clothing/suit/armor/reactive/tesla/equipped(mob/user, slot)
..()
if(slot_flags & slot) //Was equipped to a valid slot for this item?
REMOVE_TRAIT(user, TRAIT_TESLA_SHOCKIMMUNE, "reactive_tesla_armor")
ADD_TRAIT(user, TRAIT_TESLA_SHOCKIMMUNE, "reactive_tesla_armor")
/obj/item/clothing/suit/armor/reactive/tesla/cooldown_activation(mob/living/carbon/human/owner)
var/datum/effect_system/spark_spread/sparks = new /datum/effect_system/spark_spread
+7 -5
View File
@@ -70,7 +70,7 @@
var/mob/M = loc
to_chat(M,"<span class='warning'>The sensors on the [src] change rapidly!</span>")
/obj/item/clothing/under/equipped(mob/user, slot)
/obj/item/clothing/under/visual_equipped(mob/user, slot)
..()
if(adjusted)
adjusted = NORMAL_STYLE
@@ -84,10 +84,6 @@
adjusted = DIGITIGRADE_STYLE
H.update_inv_w_uniform()
if(slot == ITEM_SLOT_ICLOTHING && freshly_laundered)
freshly_laundered = FALSE
SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "fresh_laundry", /datum/mood_event/fresh_laundry)
if(attached_accessory && slot != ITEM_SLOT_HANDS && ishuman(user))
var/mob/living/carbon/human/H = user
attached_accessory.on_uniform_equip(src, user)
@@ -95,6 +91,12 @@
if(attached_accessory.above_suit)
H.update_inv_wear_suit()
/obj/item/clothing/under/equipped(mob/user, slot)
..()
if(slot == ITEM_SLOT_ICLOTHING && freshly_laundered)
freshly_laundered = FALSE
SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "fresh_laundry", /datum/mood_event/fresh_laundry)
/obj/item/clothing/under/dropped(mob/user)
if(attached_accessory)
attached_accessory.on_uniform_dropped(src, user)
@@ -17,6 +17,9 @@ INITIALIZE_IMMEDIATE(/mob/living/carbon/human/dummy)
/mob/living/carbon/human/dummy/attach_rot(mapload)
return
/mob/living/carbon/human/dummy/has_equipped(obj/item/item, slot, initial = FALSE)
return item.visual_equipped(src, slot, initial)
/mob/living/carbon/human/dummy/proc/wipe_state()
delete_equipment()
cut_overlays(TRUE)
@@ -160,7 +160,7 @@
//Item is handled and in slot, valid to call callback, for this proc should always be true
if(!not_handled)
I.equipped(src, slot, initial)
has_equipped(I, slot, initial)
// Send a signal for when we equip an item that used to cover our feet/shoes. Used for bloody feet
if((I.body_parts_covered & FEET) || (I.flags_inv | I.transparent_protection) & HIDESHOES)
+5 -1
View File
@@ -90,10 +90,14 @@
//We cannot call it for items that have not been handled as they are not yet correctly
//in a slot (handled further down inheritance chain, probably living/carbon/human/equip_to_slot
if(!not_handled)
I.equipped(src, slot)
has_equipped(I, slot, initial)
return not_handled
/// This proc is called after an item has been successfully handled and equipped to a slot.
/mob/living/carbon/proc/has_equipped(obj/item/item, slot, initial = FALSE)
return item.equipped(src, slot, initial)
/mob/living/carbon/doUnEquip(obj/item/I, force, newloc, no_move, invdrop = TRUE, silent = FALSE)
. = ..() //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.
+1 -1
View File
@@ -21,7 +21,7 @@
. = ..()
ADD_TRAIT(src, TRAIT_NODROP, HAND_REPLACEMENT_TRAIT)
/obj/item/zombie_hand/equipped(mob/user, slot)
/obj/item/zombie_hand/visual_equipped(mob/user, slot)
. = ..()
//these are intentionally inverted
var/i = user.get_held_index_of_item(src)