[Client] Handle reenabling of harvested objects via Container packet

It is no longer necessary to send ObjectState packets when harvesting objects, as the Container packet will handle the refreshing of those objects' animations instead.
pull/593/head
David Cernat 4 years ago
parent b2328b7063
commit a7f517507c

@ -293,6 +293,13 @@ void ObjectList::editContainers(MWWorld::CellStore* cellStore)
mwmp::Main::get().getCellController()->getLocalActor(ptrFound)->updateEquipment(true, true);
}
// If this container can be harvested, disable and then enable it again to refresh its animation
if (ptrFound.getClass().canBeHarvested(ptrFound))
{
MWBase::Environment::get().getWorld()->disable(ptrFound);
MWBase::Environment::get().getWorld()->enable(ptrFound);
}
// If this container was open for us, update its view
if (isCurrentContainer)
{

@ -146,28 +146,5 @@ namespace MWWorld
// Update animation object
MWBase::Environment::get().getWorld()->disable(target);
MWBase::Environment::get().getWorld()->enable(target);
/*
Start of tes3mp addition
Send ID_OBJECT_STATE packets whenever an object is harvested, as long as
the player is logged in on the server
*/
if (mwmp::Main::get().getLocalPlayer()->isLoggedIn())
{
mwmp::ObjectList* objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
objectList->addObjectState(target, false);
objectList->sendObjectState();
objectList->reset();
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
objectList->addObjectState(target, true);
objectList->sendObjectState();
}
/*
End of tes3mp addition
*/
}
}

Loading…
Cancel
Save