[Client] Send ObjectDelete packets when summoned creatures despawn

This commit is contained in:
David Cernat 2017-06-02 09:15:08 +03:00
parent 0bed33e39e
commit 8c785fb22c
3 changed files with 28 additions and 1 deletions

View file

@ -22,6 +22,7 @@
#include "../mwmp/PlayerList.hpp" #include "../mwmp/PlayerList.hpp"
#include "../mwmp/CellController.hpp" #include "../mwmp/CellController.hpp"
#include "../mwmp/MechanicsHelper.hpp" #include "../mwmp/MechanicsHelper.hpp"
#include "../mwmp/WorldEvent.hpp"
/* /*
End of tes3mp addition End of tes3mp addition
*/ */
@ -1520,6 +1521,19 @@ namespace MWMechanics
{ {
MWBase::Environment::get().getWorld()->deleteObject(ptr); MWBase::Environment::get().getWorld()->deleteObject(ptr);
/*
Start of tes3mp addition
Send an ID_OBJECT_DELETE packet every time a summoned creature despawns
*/
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->addObjectDelete(ptr);
worldEvent->sendObjectDelete();
/*
End of tes3mp addition
*/
const ESM::Static* fx = MWBase::Environment::get().getWorld()->getStore().get<ESM::Static>() const ESM::Static* fx = MWBase::Environment::get().getWorld()->getStore().get<ESM::Static>()
.search("VFX_Summon_End"); .search("VFX_Summon_End");
if (fx) if (fx)

View file

@ -175,6 +175,19 @@ namespace MWMechanics
"", ptr.getRefData().getPosition().asVec3()); "", ptr.getRefData().getPosition().asVec3());
MWBase::Environment::get().getWorld()->deleteObject(ptr); MWBase::Environment::get().getWorld()->deleteObject(ptr);
/*
Start of tes3mp addition
Send an ID_OBJECT_DELETE packet every time a summoned creature despawns
*/
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->addObjectDelete(ptr);
worldEvent->sendObjectDelete();
/*
End of tes3mp addition
*/
} }
else else
++it; ++it;

View file

@ -3405,7 +3405,7 @@ namespace MWWorld
worldEvent->addObjectSpawn(ptr); worldEvent->addObjectSpawn(ptr);
worldEvent->sendObjectSpawn(); worldEvent->sendObjectSpawn();
MWBase::Environment::get().getWorld()->deleteObject(ptr); deleteObject(ptr);
/* /*
End of tes3mp change (major) End of tes3mp change (major)
*/ */