fix(blood): Modifies remove_reagent calls to remove_blood calls

Fixes https://github.com/VOREStation/VOREStation/issues/14817

remove_reagent has no sanitization for making sure the person has at least 1 u of blood remaining, and is therefore unsafe to use.

This commit changes all human remove_reagent("blood", amt) calls with remove_blood(amt).

This should prevent blood disappearing from internal bleeding or dragging someone while they're down or from drawing blood from them and so forth.

Not all cases of remove_reagent("blood", amt) were changed, as some act on organs or other reagent containers not part of a human mob or because it's set_species
This commit is contained in:
Runa Dacino
2023-08-13 20:08:17 +02:00
parent 8ef4ccf3be
commit 09acdfd922
7 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -260,7 +260,7 @@ var/const/CE_STABLE_THRESHOLD = 0.5
return null
. = ..()
vessel.remove_reagent("blood",amount) // Removes blood if human
remove_blood(amount) // Removes blood if human
//Transfers blood from container ot vessels
/mob/living/carbon/proc/inject_blood(var/datum/reagent/blood/injected, var/amount)
+1 -1
View File
@@ -750,7 +750,7 @@ Note that amputating the affected organ does in fact remove the infection from t
if(!(W.can_autoheal() || (bicardose && inaprovaline) || myeldose)) //bicaridine and inaprovaline stop internal wounds from growing bigger with time, unless it is so small that it is already healing
W.open_wound(0.1 * wound_update_accuracy)
owner.vessel.remove_reagent("blood", wound_update_accuracy * W.damage/40) //line should possibly be moved to handle_blood, so all the bleeding stuff is in one place.
owner.remove_blood( wound_update_accuracy * W.damage/40) //line should possibly be moved to handle_blood, so all the bleeding stuff is in one place.
if(prob(1 * wound_update_accuracy))
owner.custom_pain("You feel a stabbing pain in your [name]!", 50)