Skip to content

Breath code refactoring#39263

Open
SECBATON-GRIFFON wants to merge 30 commits into
vgstation-coders:Bleeding-Edgefrom
SECBATON-GRIFFON:breath-consistency
Open

Breath code refactoring#39263
SECBATON-GRIFFON wants to merge 30 commits into
vgstation-coders:Bleeding-Edgefrom
SECBATON-GRIFFON:breath-consistency

Conversation

@SECBATON-GRIFFON

@SECBATON-GRIFFON SECBATON-GRIFFON commented May 11, 2026

Copy link
Copy Markdown
Contributor

[cleanup]

What this does

Makes these files easier to work with, moves relevant code from species into lung gas datums.
Splits off parts of breath() on carbons into separate functions such as check_breath_block() and needs_to_breathe() for modularity and less code reuse.

Why it's good

Easier maintenance for someone who wants to fix or tweak it.

How it was tested

Entering cryotubes, shelters, and wearing a plastic bag on head as a human, calling needs_to_breathe() and check_breath_block() (with a gas mask on) on humans and monkeys, immersing them in a normal room, then opening canisters of plasma and n2o, then spacewalking as each.

Changelog

No user facing changelog.

@SECBATON-GRIFFON SECBATON-GRIFFON marked this pull request as ready for review May 11, 2026 16:13
@Eneocho

Eneocho commented May 12, 2026

Copy link
Copy Markdown
Collaborator

Mr shreshident another refactor has hit the twin repos

@SECBATON-GRIFFON

Copy link
Copy Markdown
Contributor Author

Mr shreshident another refactor has hit the twin repos

necessary evil for if someone wants to try the co2 PR again but with fairer balance, or even sanitize lung popping which is my idea going forward.

@Inorien Inorien left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls verify

Comment thread code/modules/mob/living/carbon/human/life/handle_breath.dm

@Inorien Inorien left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also this

Comment thread code/modules/organs/internal/lungs/lung.dm Outdated

@Inorien Inorien left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looked at it again

Comment thread code/modules/organs/internal/lungs/lung.dm Outdated
Comment thread code/modules/organs/internal/lungs/lung.dm Outdated
@SECBATON-GRIFFON

Copy link
Copy Markdown
Contributor Author

fixed the logic, can't respond to that review for some reason

@Inorien

Inorien commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

gonna be straight with u this is an important refactor that needs to happen but its also very fragile
i really wish i had been looking at it sooner and not just dipping in and out whenever i've had time (i've been sick and busy irl) but i really need to put aside some serious time to look at it in depth given how critical breathing is.

tldr gonna stay unmerged for a bit longer until i scrape together time, hopefully next week some point

@hacker-on-steroids

Copy link
Copy Markdown
Contributor

kanef PR

not even gonna attempt to review
at least i'll know who's responsible when everything breaks after merge

@13monkeks

Copy link
Copy Markdown
Contributor

kanef PR

dont even need to read it to updoot
at least i'll know who's responsible when everything becomes objectively better after merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants