mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 13:10:02 +01:00
Fixes slightly more harddels (#58935)
This commit is contained in:
+2
-2
@@ -96,8 +96,8 @@
|
||||
|
||||
/datum/mind/Destroy()
|
||||
SSticker.minds -= src
|
||||
if(islist(antag_datums))
|
||||
QDEL_LIST(antag_datums)
|
||||
QDEL_LIST(antag_datums)
|
||||
QDEL_NULL(language_holder)
|
||||
current = null
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
|
||||
/// What kind of scars this wound will create description wise once healed
|
||||
var/scar_keyword = "generic"
|
||||
/// If we've already tried scarring while removing (since remove_wound calls qdel, and qdel calls remove wound, .....) TODO: make this cleaner
|
||||
/// If we've already tried scarring while removing (remove_wound can be called twice in a del chain, let's be nice to our code yeah?) TODO: make this cleaner
|
||||
var/already_scarred = FALSE
|
||||
/// If we forced this wound through badmin smite, we won't count it towards the round totals
|
||||
var/from_smite
|
||||
@@ -91,8 +91,7 @@
|
||||
/datum/wound/Destroy()
|
||||
if(attached_surgery)
|
||||
QDEL_NULL(attached_surgery)
|
||||
if(limb?.wounds && (src in limb.wounds)) // destroy can call remove_wound() and remove_wound() calls qdel, so we check to make sure there's anything to remove first
|
||||
remove_wound()
|
||||
remove_wound()
|
||||
set_limb(null)
|
||||
victim = null
|
||||
return ..()
|
||||
|
||||
@@ -35,12 +35,24 @@
|
||||
if(old_wound)
|
||||
blood_flow = max(old_wound.blood_flow, initial_flow)
|
||||
if(old_wound.severity > severity && old_wound.highest_scar)
|
||||
highest_scar = old_wound.highest_scar
|
||||
old_wound.highest_scar = null
|
||||
set_highest_scar(old_wound.highest_scar)
|
||||
old_wound.clear_highest_scar()
|
||||
|
||||
if(!highest_scar)
|
||||
highest_scar = new
|
||||
highest_scar.generate(limb, src, add_to_scars=FALSE)
|
||||
var/datum/scar/new_scar = new
|
||||
set_highest_scar(new_scar)
|
||||
new_scar.generate(limb, src, add_to_scars=FALSE)
|
||||
|
||||
/datum/wound/slash/proc/set_highest_scar(datum/scar/new_scar)
|
||||
if(highest_scar)
|
||||
UnregisterSignal(highest_scar, COMSIG_PARENT_QDELETING)
|
||||
if(new_scar)
|
||||
RegisterSignal(new_scar, COMSIG_PARENT_QDELETING, .proc/clear_highest_scar)
|
||||
highest_scar = new_scar
|
||||
|
||||
/datum/wound/slash/proc/clear_highest_scar(datum/source)
|
||||
SIGNAL_HANDLER
|
||||
set_highest_scar(null)
|
||||
|
||||
/datum/wound/slash/remove_wound(ignore_limb, replaced)
|
||||
if(!replaced && highest_scar)
|
||||
|
||||
Reference in New Issue
Block a user