Converts bloody_hands_mob to a weakref. (#10659)

This commit is contained in:
MarinaGryphon
2020-11-30 08:44:19 +01:00
committed by GitHub
parent 7d776d50ca
commit b8013fca16
4 changed files with 49 additions and 8 deletions
+4 -4
View File
@@ -13,11 +13,11 @@ atom/var/list/suit_fibers
atom/proc/add_fibers(mob/living/carbon/human/M)
if(M.gloves && istype(M.gloves,/obj/item/clothing/gloves))
var/obj/item/clothing/gloves/G = M.gloves
if(G.transfer_blood) //bloodied gloves transfer blood to touched objects
if(add_blood(G.bloody_hands_mob)) //only reduces the bloodiness of our gloves if the item wasn't already bloody
if(G.transfer_blood && G.bloody_hands_mob?.resolve()) //bloodied gloves transfer blood to touched objects
if(add_blood(G.bloody_hands_mob.resolve())) //only reduces the bloodiness of our gloves if the item wasn't already bloody
G.transfer_blood--
else if(M.bloody_hands)
if(add_blood(M.bloody_hands_mob))
else if(M.bloody_hands && M.bloody_hands_mob?.resolve())
if(add_blood(M.bloody_hands_mob.resolve()))
M.bloody_hands--
if(!suit_fibers) suit_fibers = list()
+2 -2
View File
@@ -1,6 +1,6 @@
/mob
var/bloody_hands = null
var/mob/living/carbon/human/bloody_hands_mob
var/datum/weakref/bloody_hands_mob
var/track_footprint = 0
var/list/feet_blood_DNA
var/track_footprint_type
@@ -8,7 +8,7 @@
/obj/item/clothing/gloves
var/transfer_blood = 0
var/mob/living/carbon/human/bloody_hands_mob
var/datum/weakref/bloody_hands_mob
/obj/item/clothing/shoes/
var/track_footprint = 0
@@ -461,11 +461,11 @@ emp_act
var/obj/item/clothing/gloves/G = gloves
G.add_blood(source)
G.transfer_blood = amount
G.bloody_hands_mob = source
G.bloody_hands_mob = WEAKREF(source)
else
add_blood(source)
bloody_hands = amount
bloody_hands_mob = source
bloody_hands_mob = WEAKREF(source)
update_inv_gloves() //updates on-mob overlays for bloody hands and/or bloody gloves
/mob/living/carbon/human/proc/bloody_body(var/mob/living/source)
+41
View File
@@ -0,0 +1,41 @@
################################
# Example Changelog File
#
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
#
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# bugfix
# wip (For works in progress)
# tweak
# soundadd
# sounddel
# rscadd (general adding of nice things)
# rscdel (general deleting of nice things)
# imageadd
# imagedel
# maptweak
# spellcheck (typo fixes)
# experiment
# balance
# admin
# backend
# security
# refactor
#################################
# Your name.
author: MoondancerPony
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True
# Any changes you've made. See valid prefix list above.
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
# SCREW THIS UP AND IT WON'T WORK.
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
changes:
- backend: "Gloves and mobs no longer keep a hardref to the mob whose blood they are covered in."