CleverRaven / CleverRaven/Cataclysm-DDA

"u_deactivate_trait" gives you the trait for free when attempting to deactivate a trait you don't have.

Open
#87,772 1 comment 0 reactions 0 assignees View on GitHub
(S2 - Confirmed) EOC: Effects On Condition
Dominant language
C++
Stars
13.1k
Forks
4.6k
Avg merge
1d 23h
Merged PRs (30d)
186

Description

### Describe the bug

Currently, "u_deactivate_trait" causes the game to give you the trait that gets deactivated, even if you didn't have it originally.

For example, Xedra Evolved's Pooka shapeshifting traits make use of "u_deactivate_trait" in order to deactivate competing traits, for example different tail traits, but currently activating a trait will instead also give your character all competing traits because "u_deactivate_trait" give the player the trait when deactivating it without them having to earn it.
There are likely other places that suffer from this bug.

As far as I know "u_add_trait" already adds traits as needed, so this is probably not necessary.

This currently gives a bunch of extra unearned traits in some situations, and fixing it via json requires workarounds that shouldn't be necessary.

### Attach save file

N/A

### Steps to reproduce

1. Create world with Xedra Evolved + character.
2. Give yourself a trait like "Antlers (Shapeshift)" or "Wolf Tail (Shapeshift)", for example.
3. Activate it.
4. Observe extra added traits.

### Expected behavior

Not giving out unearned traits.

### Screenshots

N/A

### Versions and configuration

- OS: Windows
- OS Version: 10.0.26200.8655 (25H2)
- Game Version: cdda-experimental-2026-06-23-0742-dirty+SDL3 [64-bit]
- Graphics Version: Tiles
- Game Language: System language []
- Mods loaded: [
Dark Days Ahead [dda],
Disable NPC Needs [no_npc_food],
Portal Storms Ignore NPCs [personal_portal_storms],
Xedra Evolved [xedra_evolved] (example)
]

### Additional context

N/A

Contributor guide

Open the contributing guide

Research direction

Start by locating the implementation and callers of u_deactivate_trait, then compare its behavior with u_add_trait. Reproduce the issue using the Xedra Evolved Pooka shapeshifting traits, including competing tail traits. Done means deactivating a trait the character does not have no longer grants that trait, while normal trait activation still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
game-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.