mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-29 02:06:43 +00:00
36 lines
912 B
C++
36 lines
912 B
C++
#ifndef OPENMW_PROCESSOROBJECTSOUND_HPP
|
|
#define OPENMW_PROCESSOROBJECTSOUND_HPP
|
|
|
|
#include "BaseObjectProcessor.hpp"
|
|
|
|
namespace mwmp
|
|
{
|
|
class ProcessorObjectSound final: public BaseObjectProcessor
|
|
{
|
|
public:
|
|
ProcessorObjectSound()
|
|
{
|
|
BPP_INIT(ID_OBJECT_SOUND)
|
|
}
|
|
|
|
virtual void Do(ObjectPacket &packet, ObjectList &objectList)
|
|
{
|
|
BaseObjectProcessor::Do(packet, objectList);
|
|
|
|
ptrCellStore = Main::get().getCellController()->getCellStore(objectList.cell);
|
|
|
|
if (!ptrCellStore) return;
|
|
|
|
MWBase::World* world = MWBase::Environment::get().getWorld();
|
|
|
|
// Only play sounds in active cells
|
|
if (world->isCellActive(*ptrCellStore->getCell()))
|
|
{
|
|
objectList.playObjectSounds(ptrCellStore);
|
|
}
|
|
}
|
|
|
|
};
|
|
}
|
|
|
|
#endif //OPENMW_PROCESSOROBJECTSOUND_HPP
|