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

Clean up personality "magic numbers"-->defined constants #75382

Merged

Conversation

RenechCDDA
Copy link
Member

Summary

None

Purpose of change

In #70314 I introduced constants to define the minimum and maximum allowed personality scores. However there were still some places I missed.

Describe the solution

Look through all the string results for personality and clean them up. Replace magic numbers with the constant. Much easier to change in the future if we want to change that range, and no need to wonder if -10 really was supposed to be tied to personality or not.

Describe alternatives you've considered

The debug menu still (purposefully) allows you to enter values outside of the expected range. I did not see a need to change this, but maybe I could add a note or something for the normal range.

Testing

It compiles and loads without error. Generated a few NPCs, didn't see anything outside of the -10, 10 range.

Additional context

There should be no functional changes.

@github-actions github-actions bot added NPC / Factions NPCs, AI, Speech, Factions, Ownership Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies [C++] Changes (can be) made in C++. Previously named `Code` astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions labels Aug 1, 2024
@RenechCDDA RenechCDDA marked this pull request as draft August 2, 2024 00:50
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Aug 2, 2024
@RenechCDDA RenechCDDA force-pushed the remove_npc_personality_magic_numbers branch from 48082ae to af51f20 Compare August 10, 2024 15:00
@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label Aug 10, 2024
@RenechCDDA RenechCDDA force-pushed the remove_npc_personality_magic_numbers branch from af51f20 to 30a79be Compare August 13, 2024 15:08
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Aug 13, 2024
@RenechCDDA RenechCDDA marked this pull request as ready for review August 13, 2024 16:50
@akrieger akrieger merged commit 6ea50ef into CleverRaven:master Aug 13, 2024
42 checks passed
@RenechCDDA RenechCDDA deleted the remove_npc_personality_magic_numbers branch August 13, 2024 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants