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