EMFTeam / EMF

Extended Mechanics & Flavor
34 stars 18 forks source link

When a father of an unborn child dies before the child is born, the child takes the mother's dynasty regardless of whether the marriage was matrilineal. #635

Closed zijistark closed 5 years ago

zijistark commented 5 years ago

This is a well-known vanilla ragequit bug. Let's fix it. I think it's actually simpler to fix than I previously thought:

  1. on_death of a father who has any_spouse that's is_pregnant = yes, flag that / those spouse(s) as being subject to the bug, so long as the marriage isn't matrilineal. The "flag" will actually be a saved persistent event target pointing at the father.
  2. on_birth of a child whom has a mother so flagged (i.e., the saved event target exists), set the dynasty of the child to the dynasty of the dead father.
  3. Defer an event by one day triggered upon the mother to clear said saved event target (she might have had twins or something, hence the delay to be able to handle that).

Since a woman cannot become pregnant again once she's already pregnant, there is no risk of multiple fathers needing to be saved and thus that source of ambiguity is eliminated.