From 401f21d7463a3ac288130524e6ee0f529a89d096 Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Sun, 3 Nov 2019 01:19:45 +0100 Subject: [PATCH] Fixing broken fixes. Testing. --- code/__DEFINES/is_helpers.dm | 1 + code/modules/mob/living/carbon/human/life.dm | 2 +- .../carbon/human/species_types/dullahan.dm | 23 ++++++++++--------- code/modules/surgery/bodyparts/head.dm | 4 ++-- code/modules/surgery/bodyparts/helpers.dm | 2 +- 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/code/__DEFINES/is_helpers.dm b/code/__DEFINES/is_helpers.dm index 0dee8bd1e8..04cd374022 100644 --- a/code/__DEFINES/is_helpers.dm +++ b/code/__DEFINES/is_helpers.dm @@ -56,6 +56,7 @@ #define ishumanbasic(A) (is_species(A, /datum/species/human)) #define iscatperson(A) (ishumanbasic(A) && istype(A.dna.species, /datum/species/human/felinid) ) #define isdwarf(A) (is_species(A, /datum/species/dwarf)) +#define isdullahan(A) (is_species(A, /datum/species/dullahan)) // Citadel specific species #define isipcperson(A) (is_species(A, /datum/species/ipc)) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 3326d5d117..c4ed031801 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -228,7 +228,7 @@ //END EDIT temperature = max(temperature, 2.7) //There is an occasional bug where the temperature is miscalculated in ares with a small amount of gas on them, so this is necessary to ensure that that bug does not affect this calculation. Space's temperature is 2.7K and most suits that are intended to protect against any cold, protect down to 2.0K. var/thermal_protection_flags = cold ? get_cold_protection_flags(temperature) : get_heat_protection_flags(temperature) - var/missing_body_parts_flags = missing_body_parts_flags() + var/missing_body_parts_flags = ~get_body_parts_flags() var/max_protection = 1 if(missing_body_parts_flags) //I don't like copypasta as much as proc overhead. Do you want me to make these into a macro? DISABLE_BITFIELD(thermal_protection_flags, missing_body_parts_flags) diff --git a/code/modules/mob/living/carbon/human/species_types/dullahan.dm b/code/modules/mob/living/carbon/human/species_types/dullahan.dm index 085140b5d2..d1eb262f25 100644 --- a/code/modules/mob/living/carbon/human/species_types/dullahan.dm +++ b/code/modules/mob/living/carbon/human/species_types/dullahan.dm @@ -38,13 +38,13 @@ head.icon_state = "hardhat1_pumpkin_j" head.custom_head = TRUE head.drop_limb() - ENABLE_BITFIELD(head.flags_1, HEAR_1) - head.throwforce = 25 - myhead = new /obj/item/dullahan_relay (head, H) - H.put_in_hands(head) - var/obj/item/organ/eyes/E = H.getorganslot(ORGAN_SLOT_EYES) - for(var/datum/action/item_action/organ_action/OA in E.actions) - OA.Trigger() + if(!QDELETED(head)) //drop_limb() deletes the limb if it's no drop location and dummy humans used for rendering icons are located in nullspace. Do the math. + head.throwforce = 25 + myhead = new /obj/item/dullahan_relay (head, H) + H.put_in_hands(head) + var/obj/item/organ/eyes/E = H.getorganslot(ORGAN_SLOT_EYES) + for(var/datum/action/item_action/organ_action/OA in E.actions) + OA.Trigger() /datum/species/dullahan/on_species_loss(mob/living/carbon/human/H) ENABLE_BITFIELD(H.flags_1, HEAR_1) @@ -86,7 +86,7 @@ /obj/item/organ/tongue/dullahan/handle_speech(datum/source, list/speech_args) if(ishuman(owner)) var/mob/living/carbon/human/H = owner - if(H.dna.species.id == "dullahan") + if(isdullahan(H)) var/datum/species/dullahan/D = H.dna.species if(isobj(D.myhead.loc)) var/obj/O = D.myhead.loc @@ -116,7 +116,7 @@ if(ishuman(owner)) var/mob/living/carbon/human/H = owner - if(H.dna.species.id == "dullahan") + if(isdullahan(H)) var/datum/species/dullahan/D = H.dna.species D.update_vision_perspective(H) @@ -140,7 +140,8 @@ /obj/item/dullahan_relay/proc/include_owner(list/processing_list, list/hearers) if(!QDELETED(owner)) - hearers += owner + var/list/new_hearers = hearers //It throws errors on compile about invalid expressions otherwise. And so far components only allow binary return values. + new_hearers.Add(owner) /obj/item/dullahan_relay/process() if(!istype(loc, /obj/item/bodypart/head) || QDELETED(owner)) @@ -150,7 +151,7 @@ /obj/item/dullahan_relay/Destroy() if(!QDELETED(owner)) var/mob/living/carbon/human/H = owner - if(H.dna.species.id == "dullahan") + if(isdullahan(H)) var/datum/species/dullahan/D = H.dna.species D.myhead = null owner.gib() diff --git a/code/modules/surgery/bodyparts/head.dm b/code/modules/surgery/bodyparts/head.dm index 23d49e98bb..3e6566e353 100644 --- a/code/modules/surgery/bodyparts/head.dm +++ b/code/modules/surgery/bodyparts/head.dm @@ -120,6 +120,8 @@ ..() /obj/item/bodypart/head/update_icon_dropped() + if(custom_head) + return var/list/standing = get_limb_icon(1) if(!standing.len) icon_state = initial(icon_state)//no overlays found, we default back to initial icon. @@ -130,8 +132,6 @@ add_overlay(standing) /obj/item/bodypart/head/get_limb_icon(dropped) - if(custom_head) - return cut_overlays() . = ..() if(dropped) //certain overlays only appear when the limb is being detached from its owner. diff --git a/code/modules/surgery/bodyparts/helpers.dm b/code/modules/surgery/bodyparts/helpers.dm index aacaf49f70..2419e7122d 100644 --- a/code/modules/surgery/bodyparts/helpers.dm +++ b/code/modules/surgery/bodyparts/helpers.dm @@ -334,7 +334,7 @@ S.adjusted = ALT_STYLE H.update_inv_wear_suit() -/mob/living/carbon/proc/missing_body_parts_flags() +/mob/living/carbon/proc/get_body_parts_flags() for(var/X in bodyparts) var/obj/item/bodypart/L = X switch(L.body_part)