mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-29 08:00:56 -04:00
[Client] Avoid sending repeated ObjectDelete packets about an object
This commit is contained in:
parent
7523a73346
commit
f6db7d4fc5
@ -778,10 +778,14 @@ namespace MWScript
|
|||||||
Start of tes3mp addition
|
Start of tes3mp addition
|
||||||
|
|
||||||
Send an ID_OBJECT_DELETE packet every time an object is deleted
|
Send an ID_OBJECT_DELETE packet every time an object is deleted
|
||||||
through a script
|
through a script, as long as we haven't already communicated
|
||||||
|
a deletion for it
|
||||||
*/
|
*/
|
||||||
if (mwmp::Main::get().getLocalPlayer()->isLoggedIn())
|
if (mwmp::Main::get().getLocalPlayer()->isLoggedIn() &&
|
||||||
|
ptr.getRefData().getLastCommunicatedState() != MWWorld::RefData::StateCommunication::Deleted)
|
||||||
{
|
{
|
||||||
|
ptr.getRefData().setLastCommunicatedState(MWWorld::RefData::StateCommunication::Deleted);
|
||||||
|
|
||||||
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
|
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
|
||||||
objectList->reset();
|
objectList->reset();
|
||||||
objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(runtime.getContext().getContextType());
|
objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(runtime.getContext().getContextType());
|
||||||
|
@ -150,7 +150,8 @@ namespace MWWorld
|
|||||||
{
|
{
|
||||||
None = 0,
|
None = 0,
|
||||||
Enabled = 1,
|
Enabled = 1,
|
||||||
Disabled = 2
|
Disabled = 2,
|
||||||
|
Deleted = 3
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user