From 811db42beb2ce1493bf523d360e095593b86e913 Mon Sep 17 00:00:00 2001
From: Dahlular <55758850+Dahlular@users.noreply.github.com>
Date: Sun, 4 Oct 2020 10:59:45 -0600
Subject: [PATCH] Revert "Mob_holder and examine microopt"
---
code/datums/elements/mob_holder.dm | 20 +++++++++++---------
code/game/atoms.dm | 21 +++++++++++----------
2 files changed, 22 insertions(+), 19 deletions(-)
diff --git a/code/datums/elements/mob_holder.dm b/code/datums/elements/mob_holder.dm
index 88b09685..9b9bc6f9 100644
--- a/code/datums/elements/mob_holder.dm
+++ b/code/datums/elements/mob_holder.dm
@@ -94,7 +94,7 @@
lefthand_file = left_hand
if(right_hand)
righthand_file = right_hand
- slot_flags = slots
+ slot_flags = slots
/obj/item/clothing/head/mob_holder/proc/assimilate(mob/living/target)
target.setDir(SOUTH)
@@ -102,8 +102,6 @@
target.forceMove(src)
var/image/I = new //work around to retain the same appearance to the mob idependently from inhands/worn states.
I.appearance = target.appearance
- I.layer = FLOAT_LAYER //So it doesn't get screwed up by layer overrides.
- I.plane = FLOAT_PLANE //Same as above but for planes.
I.override = TRUE
add_overlay(I)
name = target.name
@@ -113,23 +111,27 @@
w_class = WEIGHT_CLASS_TINY
if(MOB_SIZE_SMALL)
w_class = WEIGHT_CLASS_NORMAL
+ if(MOB_SIZE_HUMAN)
+ w_class = WEIGHT_CLASS_BULKY
if(MOB_SIZE_LARGE)
w_class = WEIGHT_CLASS_HUGE
+ RegisterSignal(src, COMSIG_CLICK_SHIFT, .proc/examine_held_mob, override = TRUE)
/obj/item/clothing/head/mob_holder/Destroy()
if(held_mob)
release()
return ..()
-/obj/item/clothing/head/mob_holder/examine(mob/user)
- return held_mob?.examine(user) || ..()
+/obj/item/clothing/head/mob_holder/proc/examine_held_mob(datum/source, mob/user)
+ held_mob.ShiftClick(user)
+ return COMPONENT_DENY_EXAMINATE
/obj/item/clothing/head/mob_holder/Exited(atom/movable/AM, atom/newloc)
. = ..()
if(AM == held_mob)
held_mob.reset_perspective()
held_mob = null
- QDEL_IN(src, 1) //To avoid a qdel loop.
+ qdel(src)
/obj/item/clothing/head/mob_holder/Entered(atom/movable/AM, atom/newloc)
. = ..()
@@ -159,7 +161,7 @@
/obj/item/clothing/head/mob_holder/container_resist()
if(isliving(loc))
var/mob/living/L = loc
- L.visible_message("[held_mob] escapes from [L]!", "[held_mob] escapes your grip!")
+ L.visible_message("[src] escapes from [L]!", "[src] escapes your grip!")
release()
/obj/item/clothing/head/mob_holder/assume_air(datum/gas_mixture/env)
@@ -171,7 +173,7 @@
location = location.loc
if(ismob(location))
return location.loc.assume_air(env)
- return location.assume_air(env)
+ return loc.assume_air(env)
/obj/item/clothing/head/mob_holder/remove_air(amount)
var/atom/location = loc
@@ -182,4 +184,4 @@
location = location.loc
if(ismob(location))
return location.loc.remove_air(amount)
- return location.remove_air(amount)
+ return loc.remove_air(amount)
diff --git a/code/game/atoms.dm b/code/game/atoms.dm
index 018ee2a1..23124b94 100644
--- a/code/game/atoms.dm
+++ b/code/game/atoms.dm
@@ -289,31 +289,32 @@
add_overlay(new_overlays)
/atom/proc/examine(mob/user)
- . = list("[get_examine_string(user, TRUE)].")
+ to_chat(user, get_examine_string(user, TRUE))
if(desc)
- . += desc
+ to_chat(user, desc)
+
if(reagents)
if(reagents.reagents_holder_flags & TRANSPARENT)
- . += "It contains:"
- if(length(reagents.reagent_list))
+ to_chat(user, "It contains:")
+ if(reagents.reagent_list.len)
if(user.can_see_reagents()) //Show each individual reagent
for(var/datum/reagent/R in reagents.reagent_list)
- . += "[R.volume] units of [R.name]"
+ to_chat(user, "[R.volume] units of [R.name]")
else //Otherwise, just show the total volume
var/total_volume = 0
for(var/datum/reagent/R in reagents.reagent_list)
total_volume += R.volume
- . += "[total_volume] units of various reagents"
+ to_chat(user, "[total_volume] units of various reagents")
else
- . += "Nothing."
+ to_chat(user, "Nothing.")
else if(reagents.reagents_holder_flags & AMOUNT_VISIBLE)
if(reagents.total_volume)
- . += "It has [reagents.total_volume] unit\s left."
+ to_chat(user, "It has [reagents.total_volume] unit\s left.")
else
- . += "It's empty."
+ to_chat(user, "It's empty.")
- SEND_SIGNAL(src, COMSIG_PARENT_EXAMINE, user, .)
+ SEND_SIGNAL(src, COMSIG_PARENT_EXAMINE, user)
/atom/proc/relaymove(mob/user)
if(buckle_message_cooldown <= world.time)