Skip to content

Conversation

@Starkku
Copy link
Contributor

@Starkku Starkku commented Nov 23, 2025

Attempts to address one of the issues presented in #1970 by working around the changes introduced in 9c8bd9e by replacing calling game's CRT functions. sscanf(_s) produces results with different precision from game's sscanf. Using strtod and casting the result double into float appears to be more accurate but whether or not these results are consistent across different systems I do not know.

This merely addresses the floating point number parsing in Phobos (which also replaces game's floating point number INI parser, see hook INIClass_ReadDouble_Overwrite in Misc\Hooks.INIInheritance.cpp) and does not in any way involve any potential root causes for why calling game's CRT functions is problematic in the first place.

@Starkku Starkku added ❓Phobos bug Something isn't working properly Interaction Something related to interaction with other extension, program etc. ❓Crash / Desync No Documentation Needed No documentation needed whatsoever labels Nov 23, 2025
@github-actions
Copy link

github-actions bot commented Nov 23, 2025

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

@Coronia Coronia requested a review from Belonit December 8, 2025 16:20
@Coronia
Copy link
Contributor

Coronia commented Dec 8, 2025

since we can neither reproduce the desync nor have a reliable way to test its correctness, it seems that we can only rely on more reviews on this one

@ZivDero
Copy link
Contributor

ZivDero commented Dec 8, 2025

See this issue:
FunkyFr3sh/cnc-ddraw#453

@Starkku Starkku merged commit 4be2e4d into Phobos-developers:develop Dec 10, 2025
5 of 6 checks passed
Starkku added a commit that referenced this pull request Dec 10, 2025
…1973)

Attempts to address one of the issues presented in #1970 by working
around the changes introduced in
9c8bd9e by replacing calling game's CRT
functions. `sscanf(_s)` produces results with different precision from
game's `sscanf`. Using `strtod` and casting the result double into float
appears to be more accurate but whether or not these results are
consistent across different systems I do not know.

This merely addresses the floating point number parsing in Phobos (which
also replaces game's floating point number INI parser, see hook
`INIClass_ReadDouble_Overwrite` in `Misc\Hooks.INIInheritance.cpp`) and
does not in any way involve any potential root causes for why calling
game's CRT functions is problematic in the first place.

---------

Co-authored-by: Kerbiter <crabiter@vivaldi.net>
DeathFishAtEase added a commit to DeathFishAtEase/Phobos that referenced this pull request Dec 11, 2025
DeathFishAtEase added a commit to DeathFishAtEase/Phobos that referenced this pull request Dec 11, 2025
@Starkku Starkku deleted the fix/float-parser branch December 12, 2025 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

❓Crash / Desync Interaction Something related to interaction with other extension, program etc. No Documentation Needed No documentation needed whatsoever ❓Phobos bug Something isn't working properly

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants