mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 04:15:31 +00:00
[Client] Don't delete disposed of corpses on client
Clients should instead await a server reply approving the deletion.
This commit is contained in:
parent
c3c7f2c8f9
commit
fd05beef94
1 changed files with 8 additions and 10 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue