fix(blood): Moves bloodloss scaling to before sanity checks

Mob size affects how much blood you should lose, by default 1 (20/20). However, in cases this is not true (non-medium mobs), this can lead to overflow of blood taken as this scaling happens AFTER we ensure amt is not greater than whatever it takes to get 1 blood.

This should safeguard against that.
This commit is contained in:
Runa Dacino
2023-08-13 20:11:00 +02:00
parent 09acdfd922
commit 12bb4f00bf
+3 -1
View File
@@ -210,10 +210,12 @@ var/const/CE_STABLE_THRESHOLD = 0.5
if(!amt)
return 0
amt = amt * (src.mob_size/MOB_MEDIUM)
if(amt > vessel.get_reagent_amount("blood"))
amt = vessel.get_reagent_amount("blood") - 1 // Bit of a safety net; it's impossible to add blood if there's not blood already in the vessel.
return vessel.remove_reagent("blood",amt * (src.mob_size/MOB_MEDIUM))
return vessel.remove_reagent("blood",amt)
/****************************************************
BLOOD TRANSFERS