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

NPCs with Langourus get movespeed bonus. #40045

Closed
Dacendeth opened this issue May 1, 2020 · 2 comments · Fixed by #42610
Closed

NPCs with Langourus get movespeed bonus. #40045

Dacendeth opened this issue May 1, 2020 · 2 comments · Fixed by #42610
Labels
<Bug> This needs to be fixed Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies NPC / Factions NPCs, AI, Speech, Factions, Ownership

Comments

@Dacendeth
Copy link
Contributor

Describe the bug

If a npc has Languorous they receive a pretty sizable bonus to move speed. My guess is it's not properly updating and their current stamina is above their max stamina causing a speed bonus.

Steps To Reproduce

Spawn an npc, check his current move cost and then mutate him with Languorous and watch his move cost improve and stay improved.

Expected behavior

For a negative trait of poor stamina to not make my companion run faster.

Screenshots

image

Versions and configuration

  • OS: Windows
    • OS Version: 10.0 1903
  • Game Version: 0.E-1373-gdcc42a9 [64-bit]
  • Graphics Version: Tiles
  • Game Language: System language []
  • Mods loaded: [
    Dark Days Ahead [dda],
    Disable NPC Needs [no_npc_food]
    ]

Additional context

@anothersimulacrum
Copy link
Member

If stamina is the case, then something is wrong with Character::get_stamina_max().
In npc::process_turn(), the stamina is set to get_stamina_max() every minute if their stamina is less than the value returned by get_stamina_max().

https://github.com/CleverRaven/Cataclysm-DDA/blob/master/src/npc.cpp#L2783-2785
This is get_stamina_max() for reference. It should be accounting for mutation stamina modifiers.
https://github.com/CleverRaven/Cataclysm-DDA/blob/master/src/character.cpp#L7237-L7244

@Dacendeth
Copy link
Contributor Author

Well I can tell you if you mutate them to have more max stamina, they will be initially slowed but will regenerate their stamina up to their new max, and interestingly if you mutate them to languorous after that they will be even faster.

@Night-Pryanik Night-Pryanik added <Bug> This needs to be fixed Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies NPC / Factions NPCs, AI, Speech, Factions, Ownership labels May 15, 2020
LcsTen added a commit to LcsTen/Cataclysm-DDA that referenced this issue Jul 31, 2020
Set stamina back to max_stamina if the max_stamina becomes lower than
stamina because of the Languorous mutation

fixes CleverRaven#40045
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bug> This needs to be fixed Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants