mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 09:35:28 +00:00
fix bug when you were able to kill somebody from large distance without
being spotted
This commit is contained in:
parent
6da061fd96
commit
a6ee4272aa
@ -853,8 +853,15 @@ namespace MWMechanics
|
||||
|
||||
// Find all the actors within the alarm radius
|
||||
std::vector<MWWorld::Ptr> neighbors;
|
||||
mActors.getObjectsInRange(Ogre::Vector3(player.getRefData().getPosition().pos),
|
||||
esmStore.get<ESM::GameSetting>().find("fAlarmRadius")->getInt(), neighbors);
|
||||
|
||||
Ogre::Vector3 from = Ogre::Vector3(player.getRefData().getPosition().pos);
|
||||
int radius = esmStore.get<ESM::GameSetting>().find("fAlarmRadius")->getInt();
|
||||
|
||||
mActors.getObjectsInRange(from, radius, neighbors);
|
||||
|
||||
// victim should be considered even beyond alarm radius
|
||||
if (from.squaredDistance(Ogre::Vector3(victim.getRefData().getPosition().pos)) > radius*radius)
|
||||
neighbors.push_back(victim);
|
||||
|
||||
int id = MWBase::Environment::get().getWorld()->getPlayer().getNewCrimeId();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user