mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 17:15:33 +00:00
[Client] Send ObjectSound packets with spellcasting sounds
This commit is contained in:
parent
538ccf15cf
commit
48de84ec32
1 changed files with 43 additions and 0 deletions
|
@ -361,6 +361,20 @@ namespace MWMechanics
|
|||
else
|
||||
sndMgr->playSound3D(target, schools[magicEffect->mData.mSchool]+" hit", 1.0f, 1.0f);
|
||||
|
||||
/*
|
||||
Start of tes3mp addition
|
||||
|
||||
Send an ID_OBJECT_SOUND packet every time a sound is made here
|
||||
*/
|
||||
mwmp::ObjectList* objectList = mwmp::Main::get().getNetworking()->getObjectList();
|
||||
objectList->reset();
|
||||
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
|
||||
objectList->addObjectSound(target, magicEffect->mHitSound.empty() ? schools[magicEffect->mData.mSchool] + " hit" : magicEffect->mHitSound, 1.0f, 1.0f);
|
||||
objectList->sendObjectSound();
|
||||
/*
|
||||
End of tes3mp addition
|
||||
*/
|
||||
|
||||
// Add VFX
|
||||
const ESM::Static* castStatic;
|
||||
if (!magicEffect->mHit.empty())
|
||||
|
@ -639,6 +653,20 @@ namespace MWMechanics
|
|||
};
|
||||
MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager();
|
||||
sndMgr->playSound3D(mCaster, "Spell Failure " + schools[school], 1.0f, 1.0f);
|
||||
|
||||
/*
|
||||
Start of tes3mp addition
|
||||
|
||||
Send an ID_OBJECT_SOUND packet every time a sound is made here
|
||||
*/
|
||||
mwmp::ObjectList* objectList = mwmp::Main::get().getNetworking()->getObjectList();
|
||||
objectList->reset();
|
||||
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
|
||||
objectList->addObjectSound(mCaster, "Spell Failure " + schools[school], 1.0f, 1.0f);
|
||||
objectList->sendObjectSound();
|
||||
/*
|
||||
End of tes3mp addition
|
||||
*/
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -758,6 +786,21 @@ namespace MWMechanics
|
|||
|
||||
MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager();
|
||||
sndMgr->playSound3D(mCaster, "Spell Failure " + schools[school], 1.0f, 1.0f);
|
||||
|
||||
/*
|
||||
Start of tes3mp addition
|
||||
|
||||
Send an ID_OBJECT_SOUND packet every time a sound is made here
|
||||
*/
|
||||
mwmp::ObjectList* objectList = mwmp::Main::get().getNetworking()->getObjectList();
|
||||
objectList->reset();
|
||||
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
|
||||
objectList->addObjectSound(mCaster, "Spell Failure " + schools[school], 1.0f, 1.0f);
|
||||
objectList->sendObjectSound();
|
||||
/*
|
||||
End of tes3mp addition
|
||||
*/
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue