|
|
|
@ -42,7 +42,35 @@ void MWWorld::Action::execute (const Ptr& actor)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
executeImp (actor);
|
|
|
|
|
executeImp(actor);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MWWorld::Action::execute (const Ptr& actor, float distanceToObject)
|
|
|
|
|
{
|
|
|
|
|
if(!mSoundId.empty())
|
|
|
|
|
{
|
|
|
|
|
if(mKeepSound && actor == MWMechanics::getPlayer())
|
|
|
|
|
MWBase::Environment::get().getSoundManager()->playSound(mSoundId, 1.0, 1.0,
|
|
|
|
|
MWBase::SoundManager::Play_TypeSfx, MWBase::SoundManager::Play_Normal, mSoundOffset
|
|
|
|
|
);
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
bool local = mTarget.isEmpty() || !mTarget.isInCell(); // no usable target
|
|
|
|
|
if(mKeepSound)
|
|
|
|
|
MWBase::Environment::get().getSoundManager()->playSound3D(
|
|
|
|
|
(local ? actor : mTarget).getRefData().getPosition().asVec3(),
|
|
|
|
|
mSoundId, 1.0, 1.0, MWBase::SoundManager::Play_TypeSfx,
|
|
|
|
|
MWBase::SoundManager::Play_Normal, mSoundOffset
|
|
|
|
|
);
|
|
|
|
|
else
|
|
|
|
|
MWBase::Environment::get().getSoundManager()->playSound3D(local ? actor : mTarget,
|
|
|
|
|
mSoundId, 1.0, 1.0, MWBase::SoundManager::Play_TypeSfx,
|
|
|
|
|
MWBase::SoundManager::Play_Normal, mSoundOffset
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
executeImp(actor, distanceToObject);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MWWorld::Action::setSound (const std::string& id)
|
|
|
|
|