|
|
|
@ -1860,17 +1860,14 @@ namespace MWMechanics
|
|
|
|
|
MWWorld::Ptr player = getPlayer();
|
|
|
|
|
const osg::Vec3f playerPos = player.getRefData().getPosition().asVec3();
|
|
|
|
|
bool hasHostiles = false; // need to know this to play Battle music
|
|
|
|
|
bool aiActive = MWBase::Environment::get().getMechanicsManager()->isAIActive();
|
|
|
|
|
|
|
|
|
|
if (aiActive)
|
|
|
|
|
{
|
|
|
|
|
for(PtrActorMap::iterator iter(mActors.begin()); iter != mActors.end(); ++iter)
|
|
|
|
|
{
|
|
|
|
|
if (iter->first == player) continue;
|
|
|
|
|
|
|
|
|
|
bool inProcessingRange = (playerPos - iter->first.getRefData().getPosition().asVec3()).length2() <= mActorsProcessingRange*mActorsProcessingRange;
|
|
|
|
|
if (inProcessingRange)
|
|
|
|
|
{
|
|
|
|
|
if (!inProcessingRange) continue;
|
|
|
|
|
|
|
|
|
|
MWMechanics::CreatureStats& stats = iter->first.getClass().getCreatureStats(iter->first);
|
|
|
|
|
if (!stats.isDead() && stats.getAiSequence().isInCombat())
|
|
|
|
|
{
|
|
|
|
@ -1878,8 +1875,6 @@ namespace MWMechanics
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// check if we still have any player enemies to switch music
|
|
|
|
|
static int currentMusic = 0;
|
|
|
|
|