Trap trigger_weight json filed is ignored #41538
Labels
<Bug>
This needs to be fixed
[C++]
Changes (can be) made in C++. Previously named `Code`
Fields / Furniture / Terrain / Traps
Objects that are part of the map or its features.
[JSON]
Changes (can be) made in JSON
Describe the bug
While working on #36110 I noticed a strange phenomenon: even though json sets the trigger weight of all traps as 200 grams (see below), the experiments show that the smallest weight that actually triggers a trap is >500 grams.
Cataclysm-DDA/data/json/traps.json
Lines 141 to 142 in adb3d75
After some code spelunking I discovered the cause:
Cataclysm-DDA/src/ballistics.cpp
Lines 133 to 143 in 43eebbd
Cataclysm-DDA/src/ranged.cpp
Lines 1015 to 1017 in c2b5b38
Steps To Reproduce
Expected behavior
Either the game should respect the trigger_weight json field, or this filed should be removed as dead code (every trap that lists trigger_weight sets it to 200 grams).
Screenshots
none
Versions and configuration
Dark Days Ahead [dda],
Disable NPC Needs [no_npc_food]
]
Additional context
Does the code have to be this complicated? So many knobs and dials. So much indirection. This is much simpler (pseudocode)
The text was updated successfully, but these errors were encountered: