CleverRaven / CleverRaven/Cataclysm-DDA
DANGEROUS_PROXIMITY distance not always honored (save included)
- Dominant language
- C++
- Stars
- 13.1k
- Forks
- 4.6k
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 205
Description
### Describe the bug
Sometimes the dangerously close message happens too late after you hit I or N in the monster spotted dialog window, the Zed is in a nearby square.
From _Originally posted by @Cenness in https://github.com/CleverRaven/Cataclysm-DDA/issues/63965#issuecomment-1455594230_
`
static constexpr int DANGEROUS_PROXIMITY = 5; `
it looks like the distance is hard coded at 5 at the moment but in the save attached, the monster ends at a distance of 1. (5 is fine btw).
### Attach save file
Trimmed save
[Usher-trimmed.tar.gz](https://github.com/CleverRaven/Cataclysm-DDA/files/10910123/Usher-trimmed.tar.gz)
Full save in zip format is here (80MB) if the trimmed one does not work for you :
https://1drv.ms/u/s!AgU0TIkDwXcdhI1fx9ARYGah1SudJw?e=sIMC0z
### Steps to reproduce
Ok, I managed to reproduce it:
In the save attached:
1. hit | (wait) then w wait a while then choose wait 1 minute at least
2. Popup window: "Police bot spotted" answer I (ignore)
3. Popup window: "The police bot is dangerously close" answer Y to cancel waiting
4. the bot is in the adjacent square and NOT 5 squares away
### Expected behavior
Player should be able to react when the monster crosses the DANGEROUS_PROXIMITY distance (5 atm) and NOT when the monster is 1 square away.
### Screenshots
_No response_
### Versions and configuration
- OS: Linux
- OS Version: LSB Version: core-11.1.0ubuntu4-noarch:printing-11.1.0ubuntu4-noarch:security-11.1.0ubuntu4-noarch; Distributor ID: Ubuntu; Description: Ubuntu 22.04.2 LTS; Release: 22.04; Codename: jammy;
- Game Version: 7762a54 [64-bit]
- Graphics Version: Tiles
- Game Language: English [en]
- Mods loaded: [
Dark Days Ahead [dda],
Disable NPC Needs [no_npc_food],
No Fungal Growth [no_fungal_growth],
Stats Through Skills [StatsThroughSkills],
Alternative Map Key [alt_map_key],
Bionic Professions [package_bionic_professions]
]
### Additional context
_No response_
Contributor guide
Research direction
Start by reproducing the attached save and trace the handling of the DANGEROUS_PROXIMITY constant during the monster-spotted dialog and waiting flow. Done means the player can react when the monster crosses the configured five-square distance, including when waiting is interrupted or the game is saved.
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