[Client] Don't delete disposed of corpses on client

Clients should instead await a server reply approving the deletion.
0.6.3
David Cernat 7 years ago
parent c3c7f2c8f9
commit fd05beef94

@ -372,13 +372,16 @@ namespace MWGui
if(mDragAndDrop == NULL || !mDragAndDrop->mIsOnDragAndDrop) if(mDragAndDrop == NULL || !mDragAndDrop->mIsOnDragAndDrop)
{ {
onTakeAllButtonClicked(mTakeButton); 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(); mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset(); objectList->reset();
@ -386,14 +389,9 @@ namespace MWGui
objectList->sendObjectDelete(); 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(); mPtr = MWWorld::Ptr();
} }
} }

Loading…
Cancel
Save