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

fix trapavoid monsters refusing to ever step on traps #72662

Merged
merged 1 commit into from
Mar 28, 2024

Conversation

nornagon
Copy link
Contributor

Summary

Bugfixes "Allow trap-avoiding monsters to step on traps if there's no other path"

Purpose of change

Fixes #71532, which was introduced by #68492. Monsters should be able to go
places that are dangerous if there is no other path available.

Describe the solution

Remove the know_danger_at check from monster::can_move_to. Just because a
tile is dangerous doesn't mean the monster can't step on it.

Describe alternatives you've considered

This can also be fixed by making know_danger_at not return false if the tile
is a trap, but it does seem like a trap should be "known danger". I'm not totally
sure where know_danger_at is used, so I'm not sure if that would have other
consequences.

Testing

Tested the cases in #71532 and they all work now.

Additional context

@github-actions github-actions bot added <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Mar 27, 2024
@Maleclypse Maleclypse merged commit d050eed into CleverRaven:master Mar 28, 2024
28 checks passed
@Procyonae Procyonae added the 0.H Backport PR to backport to the 0.H stable release canddiate label May 20, 2024
Procyonae pushed a commit to Procyonae/Cataclysm-DDA that referenced this pull request May 20, 2024
fix trapavoid monsters refusing to ever step on traps
@Procyonae Procyonae mentioned this pull request May 20, 2024
dseguin added a commit that referenced this pull request May 22, 2024
@Procyonae Procyonae added 0.H Backported and removed 0.H Backport PR to backport to the 0.H stable release canddiate labels May 22, 2024
@mischief mischief mentioned this pull request Jun 1, 2024
@nornagon nornagon deleted the fix-trapavoid branch June 3, 2024 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.H Backported astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Trapavoid monsters are frozen by being boxed in by traps. Again.
3 participants