Fix coverity defects

openmw-38
scrawl 9 years ago
parent e69750905a
commit 1264651af7

@ -709,7 +709,7 @@ namespace MWPhysics
bool PhysicsSystem::isOnSolidGround (const MWWorld::Ptr& actor) const bool PhysicsSystem::isOnSolidGround (const MWWorld::Ptr& actor) const
{ {
const Actor* physactor = getActor(actor); const Actor* physactor = getActor(actor);
if (!physactor->getOnGround()) if (!physactor || !physactor->getOnGround())
return false; return false;
CollisionMap::const_iterator found = mStandingCollisions.find(actor); CollisionMap::const_iterator found = mStandingCollisions.find(actor);

@ -363,9 +363,9 @@ OpenAL_SoundStream::OpenAL_SoundStream(ALuint src, DecoderPtr decoder)
switch(type) switch(type)
{ {
case SampleType_UInt8: mSilence = 0x80; case SampleType_UInt8: mSilence = 0x80; break;
case SampleType_Int16: mSilence = 0x00; case SampleType_Int16: mSilence = 0x00; break;
case SampleType_Float32: mSilence = 0x00; case SampleType_Float32: mSilence = 0x00; break;
} }
mFrameSize = framesToBytes(1, chans, type); mFrameSize = framesToBytes(1, chans, type);

@ -48,9 +48,6 @@ namespace MWSound
, mListenerUp(0,0,1) , mListenerUp(0,0,1)
, mPausedSoundTypes(0) , mPausedSoundTypes(0)
{ {
if(!useSound)
return;
mMasterVolume = Settings::Manager::getFloat("master volume", "Sound"); mMasterVolume = Settings::Manager::getFloat("master volume", "Sound");
mMasterVolume = std::min(std::max(mMasterVolume, 0.0f), 1.0f); mMasterVolume = std::min(std::max(mMasterVolume, 0.0f), 1.0f);
mSFXVolume = Settings::Manager::getFloat("sfx volume", "Sound"); mSFXVolume = Settings::Manager::getFloat("sfx volume", "Sound");
@ -67,6 +64,9 @@ namespace MWSound
mBufferCacheMax *= 1024*1024; mBufferCacheMax *= 1024*1024;
mBufferCacheMin = std::min(mBufferCacheMin*1024*1024, mBufferCacheMax); mBufferCacheMin = std::min(mBufferCacheMin*1024*1024, mBufferCacheMax);
if(!useSound)
return;
std::string hrtfname = Settings::Manager::getString("hrtf", "Sound"); std::string hrtfname = Settings::Manager::getString("hrtf", "Sound");
int hrtfstate = Settings::Manager::getInt("hrtf enable", "Sound"); int hrtfstate = Settings::Manager::getInt("hrtf enable", "Sound");

Loading…
Cancel
Save