From fd05beef9453421fd05a174765b11c86956e1df7 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Wed, 20 Jun 2018 02:01:19 +0300 Subject: [PATCH] [Client] Don't delete disposed of corpses on client Clients should instead await a server reply approving the deletion. --- apps/openmw/mwgui/container.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/apps/openmw/mwgui/container.cpp b/apps/openmw/mwgui/container.cpp index d4614b5ac..f13184527 100644 --- a/apps/openmw/mwgui/container.cpp +++ b/apps/openmw/mwgui/container.cpp @@ -372,13 +372,16 @@ namespace MWGui if(mDragAndDrop == NULL || !mDragAndDrop->mIsOnDragAndDrop) { onTakeAllButtonClicked(mTakeButton); - + + if (mPtr.getClass().isPersistent(mPtr)) + MWBase::Environment::get().getWindowManager()->messageBox("#{sDisposeCorpseFail}"); /* - Start of tes3mp addition + Start of tes3mp change (major) - Send an ID_OBJECT_DELETE packet every time a corpse is disposed of + Instead of deleting the corpse on this client, simply send an ID_OBJECT_DELETE + packet to the server as a request for the deletion */ - if (!mPtr.getClass().isPersistent(mPtr)) + else { mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList(); objectList->reset(); @@ -386,14 +389,9 @@ namespace MWGui objectList->sendObjectDelete(); } /* - End of tes3mp addition + End of tes3mp change (major) */ - if (mPtr.getClass().isPersistent(mPtr)) - MWBase::Environment::get().getWindowManager()->messageBox("#{sDisposeCorpseFail}"); - else - MWBase::Environment::get().getWorld()->deleteObject(mPtr); - mPtr = MWWorld::Ptr(); } }