Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stray characters at end of floating point value 0.000000 in item::get_var #73130

Open
IdleSol opened this issue Apr 19, 2024 · 3 comments
Open
Labels
(S2 - Confirmed) Bug that's been confirmed to exist

Comments

@IdleSol
Copy link

IdleSol commented Apr 19, 2024

Describe the bug

 DEBUG    : Stray characters at end of floating point value 0.000000 in item::get_var

 FUNCTION : double item::get_var(const std::string&, double) const
 FILE     : src/item.cpp
 LINE     : 1871
 VERSION  : cdda-experimental-2024-04-19-0435 d30757e

It happened a couple moves before the save.

Attach save file

Госпорт-trimmed.tar.gz

Steps to reproduce

N/A

Expected behavior

N/A

Screenshots

No response

Versions and configuration

  • OS: Windows
    • OS Version: 10.0.19043 (21H1)
  • Game Version: cdda-experimental-2024-04-19-0435 d30757e [64-bit]
  • Graphics Version: Tiles
  • Game Language: Русский <color_dark_gray>(90,3%) [ru]
  • Mods loaded: [
    Тёмные Дни Впереди [dda],
    Отключить потребности у НПС [no_npc_food],
    Портальные штормы игнорируют НПС [personal_portal_storms],
    Медленный рост фунгалоидов [no_fungal_growth]
    ]

Additional context

Loading from a save, doesn't cause an error.

@IdleSol IdleSol added the (S1 - Need confirmation) Report waiting on confirmation of reproducibility label Apr 19, 2024
@PatrikLundell
Copy link
Contributor

/Confirmed

I've seen it a fair bit for quite some time.

Debugging catches it in item.cpp operation item::get_var, where end is either expected to point a the end of the string to be parsed, or else point to a ',' character intended to be interpreted as the fraction separator.
However, for whatever reason, the strtod operation instead leaves it pointing to '.' after a successful(?, hard to tell if a double with a value of 0.0 has parsed the string or just the integer part) call.

Someone who think they understand how the stupid C string parsing macros work and don't work will have to take it from here (and I don't care if the macros have a fancy name like "lambda", it's still a stupid macro debuggers don't understand).
I wouldn't be completely surprised if local settings come into play anyway, such that the macro somehow uses the local convention rather than the US one of '.', so might reject '.' in such cases.

@github-actions github-actions bot added (S2 - Confirmed) Bug that's been confirmed to exist and removed (S1 - Need confirmation) Report waiting on confirmation of reproducibility labels Apr 19, 2024
@IdleSol
Copy link
Author

IdleSol commented Apr 19, 2024

I didn't understand anything.

Isn't this similar to #71635 (comment)? Something about using , as a decimal separator instead of .?

@PatrikLundell
Copy link
Contributor

It's probably similar, but probably not identical. I don't know how the macro is supposed to work, and thus don't know if the macro isn't working as expected or if the code using it is incorrect.

So far I've treated these reports as the usual garbage cluttering start of saves (complaints about the old guard quest "reward" no longer being a valid item, a pile of overmap identifier not being valid (due to improper migration), hair color not being recognized (again due to improper/missing migration) etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
(S2 - Confirmed) Bug that's been confirmed to exist
Projects
None yet
Development

No branches or pull requests

2 participants