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: NPCs no longer magically aware of explosives they can't see #4097

Merged
merged 1 commit into from
Jan 12, 2024

Conversation

chaosvolt
Copy link
Member

Purpose of change

This fixes NPCs being able to see and react to explosives they have no way of knowing are present on the other side of a wall, which negates a lot of the !!FUN!! of dynamic entry.

Describe the solution

In npcmove.cpp, set npc::find_dangerous_explosives so that the NPC in question continues on and dismisses positions that they aren't able to actually see.

Describe alternatives you've considered

Adding an extra layer to this by figuring out how to check whether the NPC is in range to hear the tick sound being given off, and if so allow them to still flee.

Testing

  1. Compiled and load-tested.
  2. Spawned in a refugee center.
  3. Deployed some C-4 on the other side of a wall from an NPC who couldn't see it.
  4. The poor sod obvliously gets toasted.
  5. Dropped C-4 where the NPC can see it.
  6. They still correctly call it out and flee.
  7. Checked affected file for astyle.

teehee:
image

no teehee:
image

Additional context

Checklist

@github-actions github-actions bot added the src changes related to source code. label Jan 12, 2024
@scarf005 scarf005 merged commit 3552f9a into cataclysmbnteam:main Jan 12, 2024
12 checks passed
@chaosvolt chaosvolt deleted the npcs-go-boom branch January 12, 2024 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
src changes related to source code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants