mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-10-05 03:26:32 +00:00
[Client] Fix cleanup of summoned creatures
Previously, summoned creatures weren't being deleted in certain situations because they were encountered again before the cell they were in had a local authority.
This commit is contained in:
parent
4e2860f578
commit
1a000bc0a8
1 changed files with 17 additions and 17 deletions
|
@ -2479,21 +2479,21 @@ namespace MWMechanics
|
||||||
void Actors::cleanupSummonedCreature (MWMechanics::CreatureStats& casterStats, int creatureActorId)
|
void Actors::cleanupSummonedCreature (MWMechanics::CreatureStats& casterStats, int creatureActorId)
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = MWBase::Environment::get().getWorld()->searchPtrViaActorId(creatureActorId);
|
MWWorld::Ptr ptr = MWBase::Environment::get().getWorld()->searchPtrViaActorId(creatureActorId);
|
||||||
if (!ptr.isEmpty())
|
|
||||||
{
|
|
||||||
/*
|
/*
|
||||||
Start of tes3mp change (major)
|
Start of tes3mp change (major)
|
||||||
|
|
||||||
Send an ID_OBJECT_DELETE packet every time a summoned creature despawns
|
Do a cleanup here and send an ID_OBJECT_DELETE packet every time a summoned creature
|
||||||
|
despawns for the local player or for a local actor
|
||||||
*/
|
*/
|
||||||
if (mwmp::Main::get().getCellController()->hasLocalAuthority(*ptr.getCell()->getCell()))
|
if (!ptr.isEmpty() &&
|
||||||
|
(casterStats.getActorId() == getPlayer().getClass().getCreatureStats(getPlayer()).getActorId() || mwmp::Main::get().getCellController()->hasLocalAuthority(*ptr.getCell()->getCell())))
|
||||||
{
|
{
|
||||||
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
|
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
|
||||||
objectList->reset();
|
objectList->reset();
|
||||||
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
|
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
|
||||||
objectList->addObjectGeneric(ptr);
|
objectList->addObjectGeneric(ptr);
|
||||||
objectList->sendObjectDelete();
|
objectList->sendObjectDelete();
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
End of tes3mp change (major)
|
End of tes3mp change (major)
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue