Skip to content

Fix desyncs due to PreceptComp_UnwillingToDo_Chance#652

Merged
notfood merged 1 commit intorwmt:devfrom
SokyranTheDragon:fix-preceptcomp-unwillingtodo-chance-desync
Aug 24, 2025
Merged

Fix desyncs due to PreceptComp_UnwillingToDo_Chance#652
notfood merged 1 commit intorwmt:devfrom
SokyranTheDragon:fix-preceptcomp-unwillingtodo-chance-desync

Conversation

@SokyranTheDragon
Copy link
Copy Markdown
Member

PreceptComp_UnwillingToDo_Chance:MemberWillingToDo uses RNG, which may be called in interface or other places that cause issues.

In vanilla, this only affects "marriage name" issue, specifically when set to "usually man's" or "usually woman's" (when playing without Ideology, it uses the former).

I've seeded the method using the pawn's ID (if present, using Find.World.ConstantRandSeed as fallback) combined with the current tick to ensure results are unique for each pawn, but will always be the same on a given tick. The fallback is mostly a precaution, as this precept comp is expecting a pawn.

This should fix desyncs that are sometimes caused due this precept comp.

This could probably be handled in a smarter way, so if anyone has an idea on how and is willing to do it - go ahead make it better.

`PreceptComp_UnwillingToDo_Chance:MemberWillingToDo` uses RNG, which may be called in interface or other places that cause issues.

In vanilla, this only affects "marriage name" issue, specifically when set to "usually man's" or "usually woman's" (when playing without Ideology, it uses the former).

I've seeded the method using the pawn's ID (if present, using `Find.World.ConstantRandSeed` as fallback) combined with the current tick to ensure results are unique for each pawn, but will always be the same on a given tick. The fallback is mostly a precaution, as this precept comp is expecting a pawn.

This should fix desyncs that are sometimes caused due this precept comp.

This could probably be handled in a smarter way, so if anyone has an idea on how and is willing to do it - go ahead make it better.
@SokyranTheDragon SokyranTheDragon added fix Fixes for a bug or desync. 1.6 Fixes or bugs relating to 1.6 (Not Odyssey). labels Aug 24, 2025
@notfood notfood added the ideology Fix or bugs relating to Ideology (Not 1.3) label Aug 24, 2025
@notfood notfood moved this to In review in 1.6 and Odyssey Aug 24, 2025
Copy link
Copy Markdown
Member

@notfood notfood left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@notfood notfood merged commit f125b81 into rwmt:dev Aug 24, 2025
1 check passed
@github-project-automation github-project-automation bot moved this from In review to Done in 1.6 and Odyssey Aug 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.6 Fixes or bugs relating to 1.6 (Not Odyssey). fix Fixes for a bug or desync. ideology Fix or bugs relating to Ideology (Not 1.3)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants