Fixed wound creation with shrapnel (#21952)

Woops

---------

Signed-off-by: Cody Brittain <1779662+Generalcamo@users.noreply.github.com>
Co-authored-by: GeneralCamo <n/a>
This commit is contained in:
Cody Brittain
2026-03-01 22:18:47 -05:00
committed by GitHub
parent f3f4dc0eae
commit 9bf9aed31c
2 changed files with 68 additions and 2 deletions
+10 -2
View File
@@ -1425,6 +1425,8 @@ Note that amputating the affected organ does in fact remove the infection from t
else
return FALSE
#define EMBED_BASE_DAMAGE 5
/obj/item/organ/external/proc/embed(obj/item/W, silent = FALSE, supplied_message, datum/wound/supplied_wound)
if(!owner || loc != owner)
return
@@ -1439,11 +1441,15 @@ Note that amputating the affected organ does in fact remove the infection from t
owner.visible_message(SPAN_DANGER("\The [W] sticks in [owner]'s wound!"),
SPAN_DANGER("\The [W] sticks in your wound!"))
if(supplied_wound)
//Did we not get a supplied wound? Start by finding an existing wound that fits.
if(!supplied_wound)
for(var/datum/wound/wound as anything in wounds)
if ((wound.damage_type == INJURY_TYPE_CUT || wound.damage_type == INJURY_TYPE_PIERCE) && wound.damage >= W.w_class * 5)
if ((wound.damage_type == INJURY_TYPE_CUT || wound.damage_type == INJURY_TYPE_PIERCE) && wound.damage >= W.w_class * EMBED_BASE_DAMAGE)
supplied_wound = wound
break
//Nothing still? Make a new wound for this object to embed in.
if(!supplied_wound)
supplied_wound = createwound(INJURY_TYPE_PIERCE, W.w_class * EMBED_BASE_DAMAGE)
if(!supplied_wound || (W in supplied_wound.embedded_objects)) // Just in case.
return
@@ -1458,6 +1464,8 @@ Note that amputating the affected organ does in fact remove the infection from t
H.drop_from_inventory(W,owner)
W.forceMove(owner)
#undef EMBED_BASE_DAMAGE
/obj/item/organ/external/removed(var/mob/living/user, var/ignore_children = 0)
if(!owner)