mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-14 02:43:16 +00:00
## About The Pull Request When testing for plasmaman reagent stuff I noticed that oddly plasmamen were still taking toxloss damage from plasma in cases they shouldn't, since they are `MOB_MINERAL` and toxins affect `MOB_ORGANIC`. ``` /datum/reagent /// The affected biotype, if the reagent damages/heals generic damage (Toxin/Oxygen) of an affected mob. /// See "Mob bio-types flags" in /code/_DEFINES/mobs.dm var/affected_biotype = MOB_ORGANIC ``` ``` /datum/reagent/toxin/on_mob_life(mob/living/carbon/affected_mob, delta_time, times_fired) if(toxpwr && affected_mob.health > health_required) affected_mob.adjustToxLoss(toxpwr * REM * normalise_creation_purity() * delta_time, FALSE, required_biotype = affected_biotype) . = TRUE ..() ``` It should be the case that non-organics do not take tox damage from toxins that only target organics. But they still were. My hunch was that the cause is this in /code/__DEFINES/mobs.dm, and that seems the case after testing: ``` //Mob bio-types flags #define MOB_ORGANIC (1 << 0) ``` Since FALSE = 0 in dm language , this causes ``` /mob/living/carbon/adjustToxLoss(amount, updating_health = TRUE, forced = FALSE, required_biotype) if(required_biotype && !(mob_biotypes & required_biotype)) ``` `if(required_biotype)` to always evaluate to false when `required_biotype` is set to `MOB_ORGANIC`. Which is currently the case for all toxins. So in essence the second part of the expression is never going to get a chance to evaluate true because the first part always fails for every single reagent. I'm not sure if this is intentional or not but it seems like a big oversight to me. Like the initial coder thought they were sanity checking an object not being null, but it's a bitflag not an obj... Made a small change so that it works now. ## Why It's Good For The Game Fixes a bug. Gets rid of unexpected behavior. If anyone tries to add a future reagent that only affects a certain type of mob biology, now it will actually work how they think it will. It took a lot of head scratching for me to realize what the problem was and I don't want anyone else to go through that! ## Changelog 🆑 fix: fixed mob biotypes being ignored when applying toxin damage and oxyloss /🆑