mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-25 14:00:18 +01:00
Refactor Get Pain (#22847)
This PR refactors get_pain() to be essentially performance free. Previously it was a member of the top 5 most expensive procs. I had to touch a metric shitton of files to make this happen. Notably get_pain() was also 1/3rd of the entire processing cost for Mobs - Life
This commit is contained in:
@@ -282,10 +282,10 @@
|
||||
for(var/obj/item/organ/external/org in damaged)
|
||||
var/limb_name = "[capitalize(org.name)][BP_IS_ROBOTIC(org) ? " (Cybernetic)" : ""]"
|
||||
var/limb_result = ""
|
||||
if(org.brute_dam > 0)
|
||||
limb_result = " [SPAN_SCAN_DANGER("[get_wound_severity(org.brute_dam, (org.limb_flags & ORGAN_HEALS_OVERKILL), TRUE)] physical trauma")]"
|
||||
if(org.burn_dam > 0)
|
||||
limb_result = "[limb_result][limb_result ? " | " : " "][SPAN_SCAN_ORANGE_DANGER("[get_wound_severity(org.burn_dam, (org.limb_flags & ORGAN_HEALS_OVERKILL), TRUE)] burns")]"
|
||||
if(LIMB_GET_BRUTE_DAMAGE(org) > 0)
|
||||
limb_result = " [SPAN_SCAN_DANGER("[get_wound_severity(LIMB_GET_BRUTE_DAMAGE(org), (org.limb_flags & ORGAN_HEALS_OVERKILL), TRUE)] physical trauma")]"
|
||||
if(LIMB_GET_BURN_DAMAGE(org) > 0)
|
||||
limb_result = "[limb_result][limb_result ? " | " : " "][SPAN_SCAN_ORANGE_DANGER("[get_wound_severity(LIMB_GET_BURN_DAMAGE(org), (org.limb_flags & ORGAN_HEALS_OVERKILL), TRUE)] burns")]"
|
||||
if(org.status & ORGAN_BLEEDING)
|
||||
limb_result = "[limb_result][limb_result ? " | " : " "][SPAN_SCAN_DANGER("bleeding")]"
|
||||
var/is_bandaged = org.is_bandaged()
|
||||
@@ -330,7 +330,7 @@
|
||||
var/found_disloc
|
||||
for(var/obj/item/organ/external/e in H.organs)
|
||||
if(e)
|
||||
if(!found_disloc && e.dislocated == 2)
|
||||
if(!found_disloc && LIMB_GET_DISLOCATED(e) == 2)
|
||||
dat += SPAN_SCAN_WARNING("Dislocation detected. Advanced scanner required for location.")
|
||||
found_disloc = TRUE
|
||||
if(!found_bleed && (e.status & ORGAN_ARTERY_CUT))
|
||||
|
||||
Reference in New Issue
Block a user