mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-28 02:39:42 +00:00
[Client] Avoid sending repeated ObjectDelete packets about an object
This commit is contained in:
parent
7523a73346
commit
f6db7d4fc5
2 changed files with 8 additions and 3 deletions
|
@ -778,10 +778,14 @@ namespace MWScript
|
|||
Start of tes3mp addition
|
||||
|
||||
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();
|
||||
objectList->reset();
|
||||
objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(runtime.getContext().getContextType());
|
||||
|
|
|
@ -150,7 +150,8 @@ namespace MWWorld
|
|||
{
|
||||
None = 0,
|
||||
Enabled = 1,
|
||||
Disabled = 2
|
||||
Disabled = 2,
|
||||
Deleted = 3
|
||||
};
|
||||
|
||||
private:
|
||||
|
|
Loading…
Reference in a new issue