blob: 315594a09580b83e7101d8e5a0f1a61cfc3675d9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
From 3552f9a79d6c3ea29b1fb694c6d6839704ca64af Mon Sep 17 00:00:00 2001
From: Chaosvolt <chaosvolt@users.noreply.github.com>
Date: Thu, 11 Jan 2024 19:39:05 -0600
Subject: [PATCH] fix: NPCs no longer magically aware of explosives they can't
see (#4097)
---
src/npcmove.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/npcmove.cpp b/src/npcmove.cpp
index 9569a31f099..b7ee6f6df0e 100644
--- a/src/npcmove.cpp
+++ b/src/npcmove.cpp
@@ -315,6 +315,10 @@ std::vector<sphere> npc::find_dangerous_explosives() const
continue;
}
+ if( !sees( elem->position() ) ) {
+ continue; // We can't worry about what we can't see.
+ }
+
const explosion_iuse *actor = dynamic_cast<const explosion_iuse *>( use->get_actor_ptr() );
const int safe_range = actor->explosion.safe_range();
--
2.43.0
|