Skip to content
Snippets Groups Projects

Fix heterochromia by generating genetic quirks early

Merged Anu requested to merge Anu/fc-pregmod:anu-fix into pregmod-master

Because of the way GenerateNewSlave() was ordered, with genetic quirks being generated after racial traits (including eye color), any slave that would have generated with natural expressed heterochromia was being left with a nonfunctional 2 for its value rather than being converted into a color string as intended. Since generate(XX/XY)GeneticQuirks() doesn't care about anything but sex, and nothing in preGenCombinedStats() seems to consult slave.geneticQuirks, I've moved generate(XX/XY)GeneticQuirks() out of generate(XX/XY)Slave() to a separate call before preGenCombinedStats(), which fixes the issue without any adverse effects I can pick up on in testing.

As this is a change to the order of operations in one of the most important files in the game, though, I'd strongly recommend close examination and testing to make sure I haven't fucked anything up somehow.

Heterochromia from slave breeding and the one or two events that set it manually are already handled correctly, as far as I'm aware.

Merge Checklist
  • I have read CONTRIBUTING.md
    • and
      • my code editor has
        • ESLint support enabled
        • TypeScript support enabled
        • some form of spell checker
          • We suggest using a spell checker compatible with cSpell if possible
      • my changes compile successfully and seem to work properly
      • I am using the simple compiler (simple-compiler.[bat or sh])
      • I am using the normal compiler (compile.[bat or sh])
      • this is my first merge request
      • the changes in this merge request comply with the coding style defined in CONTRIBUTING.md
Changes made
  • Adjusts GenerateNewSlave() to generate genetic quirks before rather than after generating racial traits, so that slaves with natural heterochromia are assigned a valid string instead of a nonfunctional 2.

Things left to do

  • code review (this is done by one or more people other than you)
  • final tests
  • let Pregmodder know that this is ready for merging

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading