From 2189ea1a63ee2dd8176cd863baa758a9f115abef Mon Sep 17 00:00:00 2001 From: David Cernat Date: Sun, 22 Jul 2018 16:43:27 +0300 Subject: [PATCH] [Client] Clean up sending of Container packets --- apps/openmw/mwgui/container.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/apps/openmw/mwgui/container.cpp b/apps/openmw/mwgui/container.cpp index daa503635..d4b930545 100644 --- a/apps/openmw/mwgui/container.cpp +++ b/apps/openmw/mwgui/container.cpp @@ -122,9 +122,7 @@ namespace MWGui MWWorld::Ptr itemPtr = mModel->getItem(mSelectedItem).mBase; objectList->addContainerItem(baseObject, itemPtr, count); objectList->addObject(baseObject); - - mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->setObjectList(objectList); - mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->Send(); + objectList->sendContainer(); LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Sending ID_CONTAINER about\n- Ptr cellRef: %s, %i\n- cell: %s\n- item: %s, %i", baseObject.refId.c_str(), baseObject.refNum, objectList->cell.getDescription().c_str(), @@ -177,9 +175,7 @@ namespace MWGui baseObject.containerItems.push_back(containerItem); objectList->addObject(baseObject); - - mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->setObjectList(objectList); - mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->Send(); + objectList->sendContainer(); LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Sending ID_CONTAINER about\n- Ptr cellRef: %s %i-%i\n- cell: %s\n- item: %s %i, %i", baseObject.refId.c_str(), baseObject.refNum, baseObject.mpNum, objectList->cell.getDescription().c_str(), @@ -304,9 +300,7 @@ namespace MWGui objectList->action = mwmp::BaseObjectList::REMOVE; objectList->containerSubAction = mwmp::BaseObjectList::TAKE_ALL; objectList->addEntireContainer(mPtr); - - mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->setObjectList(objectList); - mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->Send(); + objectList->sendContainer(); LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Sending ID_CONTAINER about\n- Ptr cellRef: %s, %i-%i\n- cell: %s", mPtr.getCellRef().getRefId().c_str(), mPtr.getCellRef().getRefNum().mIndex, mPtr.getCellRef().getMpNum(),