mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-10-05 06:56:32 +00:00
[Client] Send ObjectSound for items dropped locally
This commit is contained in:
parent
b8839e87c8
commit
51861c767f
1 changed files with 15 additions and 2 deletions
|
@ -414,6 +414,11 @@ void ObjectList::placeObjects(MWWorld::CellStore* cellStore)
|
||||||
{
|
{
|
||||||
MWBase::World *world = MWBase::Environment::get().getWorld();
|
MWBase::World *world = MWBase::Environment::get().getWorld();
|
||||||
|
|
||||||
|
static mwmp::ObjectList soundObjectList;
|
||||||
|
soundObjectList.reset();
|
||||||
|
soundObjectList.packetOrigin = mwmp::CLIENT_GAMEPLAY;
|
||||||
|
soundObjectList.cell = cell;
|
||||||
|
|
||||||
for (const auto &baseObject : baseObjects)
|
for (const auto &baseObject : baseObjects)
|
||||||
{
|
{
|
||||||
LOG_APPEND(TimedLog::LOG_VERBOSE, "- cellRef: %s %i-%i, count: %i, charge: %i, enchantmentCharge: %.2f, soul: %s",
|
LOG_APPEND(TimedLog::LOG_VERBOSE, "- cellRef: %s %i-%i, count: %i, charge: %i, enchantmentCharge: %.2f, soul: %s",
|
||||||
|
@ -455,10 +460,13 @@ void ObjectList::placeObjects(MWWorld::CellStore* cellStore)
|
||||||
|
|
||||||
if (baseObject.droppedByPlayer)
|
if (baseObject.droppedByPlayer)
|
||||||
{
|
{
|
||||||
MWBase::Environment::get().getSoundManager()->playSound3D(newPtr, newPtr.getClass().getDownSoundId(newPtr), 1.f, 1.f);
|
|
||||||
|
|
||||||
if (guid == Main::get().getLocalPlayer()->guid)
|
if (guid == Main::get().getLocalPlayer()->guid)
|
||||||
|
{
|
||||||
world->PCDropped(newPtr);
|
world->PCDropped(newPtr);
|
||||||
|
|
||||||
|
// If this item was dropped locally, queue item drop sound
|
||||||
|
soundObjectList.addObjectSound(newPtr, newPtr.getClass().getDownSoundId(newPtr), 1.0, 1.0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (std::exception&)
|
catch (std::exception&)
|
||||||
|
@ -469,6 +477,11 @@ void ObjectList::placeObjects(MWWorld::CellStore* cellStore)
|
||||||
else
|
else
|
||||||
LOG_APPEND(TimedLog::LOG_VERBOSE, "-- Object already existed!");
|
LOG_APPEND(TimedLog::LOG_VERBOSE, "-- Object already existed!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (soundObjectList.baseObjects.size() > 0)
|
||||||
|
{
|
||||||
|
soundObjectList.sendObjectSound();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectList::spawnObjects(MWWorld::CellStore* cellStore)
|
void ObjectList::spawnObjects(MWWorld::CellStore* cellStore)
|
||||||
|
|
Loading…
Reference in a new issue