Skip to content

VariantWriter::write: Fix writing negative infinity when p_compat is true#104991

Merged
Repiteo merged 1 commit into
godotengine:masterfrom
nikitalita:fix_inf_neg
Apr 7, 2025
Merged

VariantWriter::write: Fix writing negative infinity when p_compat is true#104991
Repiteo merged 1 commit into
godotengine:masterfrom
nikitalita:fix_inf_neg

Conversation

@nikitalita
Copy link
Copy Markdown
Contributor

see here: #101618 (comment)

We now default to writing -inf instead of inf_neg when writing a -infinity float; however, previous versions of the variant parser did not support reading -inf, and we still explicitly support writing variants that are compatible with previous text format versions with the p_compat flag. As such, when we write an -infinity float, we should check if the p_compat flag is set, and write inf_neg if it is.

@nikitalita nikitalita requested a review from a team as a code owner April 3, 2025 21:43
Copy link
Copy Markdown
Member

@aaronfranke aaronfranke left a comment

Choose a reason for hiding this comment

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

Makes sense to me.

@aaronfranke aaronfranke added this to the 4.5 milestone Apr 4, 2025
@Repiteo Repiteo merged commit b9665b9 into godotengine:master Apr 7, 2025
20 checks passed
@Repiteo
Copy link
Copy Markdown
Contributor

Repiteo commented Apr 7, 2025

Thanks!

@akien-mga akien-mga changed the title VariantWriter::write: fix writing negative infinity when p_compat is true VariantWriter::write: Fix writing negative infinity when p_compat is true Apr 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants