mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 05:00:55 +01:00
Extremely minor reagent optimization (#93645)
## About The Pull Request Saves us like, 10,000 - 20,000 lists per round by not initing a list for every reagent Uses a signal to handle allergic reactions blocking metabolism rather than adding behavior `/reagent` ## Why It's Good For The Game Will it matter? Probably not, is it cleaner? Heck yeah ## Changelog 🆑 Melbert qol: Tox damage from allergic reactions is affected by tox damage modifiers refactor: Changed how allergic reactions to chem pause metabolism, report any oddities /🆑
This commit is contained in:
@@ -95,7 +95,8 @@
|
||||
if(!owner || !reagent || (dead && !(reagent.chemical_flags & REAGENT_DEAD_PROCESS)))
|
||||
return FALSE
|
||||
|
||||
if(owner.reagent_tick(reagent, seconds_per_tick, times_fired))
|
||||
var/tick_return = owner.reagent_tick(reagent, seconds_per_tick, times_fired)
|
||||
if(tick_return & COMSIG_MOB_STOP_REAGENT_TICK)
|
||||
return FALSE
|
||||
|
||||
if(liverless && !reagent.self_consuming) //need to be metabolized
|
||||
@@ -124,7 +125,7 @@
|
||||
if(dead && !QDELETED(owner) && !QDELETED(reagent))
|
||||
need_mob_update += reagent.on_mob_dead(owner, seconds_per_tick)
|
||||
|
||||
if(!QDELETED(owner) && !QDELETED(reagent))
|
||||
if(!QDELETED(owner) && !QDELETED(reagent) && !(tick_return & COMSIG_MOB_STOP_REAGENT_METABOLISM))
|
||||
reagent.metabolize_reagent(owner, seconds_per_tick, times_fired)
|
||||
|
||||
return need_mob_update
|
||||
|
||||
@@ -42,8 +42,6 @@
|
||||
var/metabolizing = FALSE
|
||||
/// Are we from a material? We might wanna know that for special stuff. Like metalgen. Is replaced with a ref of the material on New()
|
||||
var/datum/material/material
|
||||
///A list of causes why this chem should skip being removed, if the length is 0 it will be removed from holder naturally, if this is >0 it will not be removed from the holder.
|
||||
var/list/reagent_removal_skip_list = list()
|
||||
///The set of exposure methods this penetrates skin with.
|
||||
var/penetrates_skin = VAPOR
|
||||
/// See fermi_readme.dm REAGENT_DEAD_PROCESS, REAGENT_INVISIBLE, REAGENT_SNEAKYNAME, REAGENT_SPLITRETAINVOL, REAGENT_CANSYNTH, REAGENT_IMPURE
|
||||
@@ -170,8 +168,6 @@
|
||||
|
||||
///Metabolizes a portion of the reagent after on_mob_life() is called
|
||||
/datum/reagent/proc/metabolize_reagent(mob/living/carbon/affected_mob, seconds_per_tick, times_fired)
|
||||
if(length(reagent_removal_skip_list))
|
||||
return
|
||||
if(isnull(holder))
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user