CleverRaven / CleverRaven/Cataclysm-DDA

limb removing mutations causes errors on each turn

Open
#64,474 2 comments 0 reactions 0 assignees View on GitHub
(P3 - Medium) (S2 - Confirmed) [C++] Help Wanted Limbs
Dominant language
C++
Stars
13.2k
Forks
4.6k
Avg merge
2d 1h
Merged PRs (30d)
205

Description

### Describe the bug

limb removing mutations like debug only head `DEBUG _NO_TORSO` causes error message for each limb after it mutates:

` DEBUG : Could not find bodypart arm_l in Roman Hansel's body

FUNCTION : get_part
FILE : D:\a\Cataclysm-DDA\Cataclysm-DDA\src\creature.cpp
LINE : 2001
VERSION : 1eca109
`
it continues with every other limb which is missing
it repeats every turn, as it checks the limbs it trying to remove dont exist, yet removing them and causes errors
ignoring error with i button stops the error messages, and character continues the game with only head without no problem

### Attach save file

[North Hornell-trimmed.tar.gz](https://github.com/CleverRaven/Cataclysm-DDA/files/11043504/North.Hornell-trimmed.tar.gz)

### Steps to reproduce

enter debug mode mutation menu
select limb removing mutation, such as debug no torso
activate it

### Expected behavior

after realising arms game trying to remove doesnt exist, it should stop trying to remove them
or alternatively, mutations should not use enchantment that activates every turn

### Screenshots

_No response_

### Versions and configuration

- OS: Windows
- OS Version: 10.0.19044.2604 (21H2)
- Game Version: 1eca109 [64-bit]
- Graphics Version: Tiles
- Game Language: System language []
- Mods loaded: [
Dark Days Ahead [dda],
Limb Test [limb_test]
]

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Reproduce with the attached save and the Limb Test mod by activating a limb-removing mutation from the debug mutation menu. Start in src/creature.cpp at get_part and trace the repeated missing-bodypart errors. Done means removing nonexistent limbs no longer produces an error on every turn, while the character can continue with the remaining body parts.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.