mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 15:17:01 +01:00
[MIRROR] Fix organ damage being uncapped [MDB IGNORE] (#22161)
* Fix organ damage being uncapped * Update damage_procs.dm --------- Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com> Co-authored-by: Bloop <vinylspiders@gmail.com>
This commit is contained in:
co-authored by
MrMelbert
Bloop
parent
3fd2f8134b
commit
b262fa48ce
@@ -116,7 +116,7 @@
|
||||
* * maximum - currently an arbitrarily large number, can be set so as to limit damage
|
||||
* * required_organ_flag - targets only a specific organ type if set to ORGAN_ORGANIC or ORGAN_ROBOTIC
|
||||
*/
|
||||
/mob/living/carbon/adjustOrganLoss(slot, amount, maximum = INFINITY, required_organ_flag = NONE)
|
||||
/mob/living/carbon/adjustOrganLoss(slot, amount, maximum, required_organ_flag = NONE)
|
||||
var/obj/item/organ/affected_organ = get_organ_slot(slot)
|
||||
if(!affected_organ || (status_flags & GODMODE))
|
||||
return
|
||||
|
||||
@@ -240,6 +240,7 @@ INITIALIZE_IMMEDIATE(/obj/item/organ)
|
||||
/obj/item/organ/proc/apply_organ_damage(damage_amount, maximum = maxHealth, required_organ_flag = NONE) //use for damaging effects
|
||||
if(!damage_amount) //Micro-optimization.
|
||||
return
|
||||
maximum = clamp(maximum, 0, maxHealth) // the logical max is, our max
|
||||
if(maximum < damage)
|
||||
return
|
||||
if(required_organ_flag && !(organ_flags & required_organ_flag))
|
||||
|
||||
Reference in New Issue
Block a user