mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-05 12:11:34 +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
1 changed files with 9 additions and 2 deletions
|
@ -853,8 +853,15 @@ namespace MWMechanics
|
||||||
|
|
||||||
// Find all the actors within the alarm radius
|
// Find all the actors within the alarm radius
|
||||||
std::vector<MWWorld::Ptr> neighbors;
|
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();
|
int id = MWBase::Environment::get().getWorld()->getPlayer().getNewCrimeId();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue