mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-12 15:47:04 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user