Skip to content

refactor(port): migrate to units::temperature based body temperature - #9131

Open
scarf005 wants to merge 2 commits into
cataclysmbn:mainfrom
scarf005:refactor/body-temperature-units
Open

refactor(port): migrate to units::temperature based body temperature#9131
scarf005 wants to merge 2 commits into
cataclysmbn:mainfrom
scarf005:refactor/body-temperature-units

Conversation

@scarf005

@scarf005 scarf005 commented May 28, 2026

Copy link
Copy Markdown
Member

Purpose of change (The Why)

related: #2570, #397, #1417

Describe the solution (The How)

  • body-temperature delta helpers under src/units/
  • converts body-part current/converged temperature APIs and body-temperature constants to typed units
  • converts legacy JSON/save/Lua BTU values at function boundaries
  • deprecated *_btu Lua bindings and added Celsius bindings
  • preserves BN's legacy body-temperature math at calculation boundaries while using typed int millidegree Celsius units internally

Testing

image image

playtested for a bit, bodytemps seems to work as intended, e.g getting cold or warm

Checklist

Mandatory

Optional

  • This PR used AI assistance.
  • This PR ports someone else's contribution (e.g from DDA or other fork).
    • I have added port scope to the PR title.
    • I have attributed original authors in the commit messages adding Co-Authored-By in the commit message.
    • I have linked the URL of original PR(s) in the description.
  • This is a C++ PR that modifies JSON loading or behavior.
    • I have documented the changes in the appropriate location in the docs/ folder.
    • If documentation for this feature does not exist, please write it or at least note its lack in PR description.
    • New localizable fields need to be added to the lang/bn_extract_json_strings.sh script if it does not support them yet.
    • If applicable, add checks on game load that would validate the loaded data.
    • If it modifies format of save files, please add migration from the old format.
  • This PR modifies lua scripts or the lua API.

PR opened by gpt-5.5 high on pi

Build Artifacts

PR build for commit 1f2468b (Merge branch 'main' into refactor/body-temperature-units) on 2026-07-24 01:52:41

@github-actions github-actions Bot added src changes related to source code. tests changes related to tests lua PRs and issues related to Lua scripting labels May 28, 2026
@scarf005 scarf005 added this to the Stable 0.13.0 milestone May 28, 2026
@scarf005 scarf005 changed the title refactor(port,lua): port body temperature units for post-0.12.0 refactor(port,lua): migrate to units::temperature based body temperature May 28, 2026
@scarf005
scarf005 force-pushed the refactor/body-temperature-units branch from 6c92d5f to c67f870 Compare June 5, 2026 14:23
@scarf005
scarf005 force-pushed the refactor/body-temperature-units branch from c67f870 to 071f386 Compare June 17, 2026 02:29
@scarf005
scarf005 marked this pull request as ready for review June 17, 2026 02:29
@cataclysmbn cataclysmbn deleted a comment from autofix-ci Bot Jun 17, 2026
@scarf005
scarf005 force-pushed the refactor/body-temperature-units branch from a626470 to aca83de Compare June 18, 2026 14:28
@scarf005
scarf005 marked this pull request as draft June 26, 2026 01:08
@scarf005
scarf005 force-pushed the refactor/body-temperature-units branch 3 times, most recently from 072a699 to 0cd4ee9 Compare July 2, 2026 12:36
@cataclysmbn cataclysmbn deleted a comment from autofix-ci Bot Jul 2, 2026
@scarf005
scarf005 force-pushed the refactor/body-temperature-units branch from 566507e to 108755c Compare July 2, 2026 15:28
@scarf005
scarf005 marked this pull request as ready for review July 2, 2026 15:34
@scarf005 scarf005 changed the title refactor(port,lua): migrate to units::temperature based body temperature refactor(port): migrate to units::temperature based body temperature Jul 2, 2026
Port CleverRaven/Cataclysm-DDA#68796.

Co-authored-by: prharvey <2677507+prharvey@users.noreply.github.com>
Assisted-by: pi:gpt-5.5
Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
@scarf005
scarf005 force-pushed the refactor/body-temperature-units branch from 108755c to 6b5b125 Compare July 8, 2026 04:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lua PRs and issues related to Lua scripting src changes related to source code. tests changes related to tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant