2013-04-06 19:48:52 +00:00
|
|
|
|
|
|
|
#include "soundcheck.hpp"
|
|
|
|
|
|
|
|
#include <sstream>
|
|
|
|
|
|
|
|
#include <components/esm/loadskil.hpp>
|
|
|
|
|
|
|
|
#include "../world/universalid.hpp"
|
|
|
|
|
|
|
|
CSMTools::SoundCheckStage::SoundCheckStage (const CSMWorld::IdCollection<ESM::Sound>& sounds)
|
|
|
|
: mSounds (sounds)
|
|
|
|
{}
|
|
|
|
|
|
|
|
int CSMTools::SoundCheckStage::setup()
|
|
|
|
{
|
|
|
|
return mSounds.getSize();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CSMTools::SoundCheckStage::perform (int stage, std::vector<std::string>& messages)
|
|
|
|
{
|
2013-09-27 08:08:09 +00:00
|
|
|
const CSMWorld::Record<ESM::Sound>& record = mSounds.getRecord (stage);
|
|
|
|
|
|
|
|
if (record.isDeleted())
|
|
|
|
return;
|
|
|
|
|
|
|
|
const ESM::Sound& sound = record.get();
|
2013-04-06 19:48:52 +00:00
|
|
|
|
|
|
|
CSMWorld::UniversalId id (CSMWorld::UniversalId::Type_Sound, sound.mId);
|
|
|
|
|
|
|
|
if (sound.mData.mMinRange>sound.mData.mMaxRange)
|
|
|
|
messages.push_back (id.toString() + "|Maximum range larger than minimum range");
|
|
|
|
|
|
|
|
/// \todo check, if the sound file exists
|
|
|
|
}
|