diff --git a/apps/openmw-mp/Script/Functions/World.cpp b/apps/openmw-mp/Script/Functions/World.cpp index 3d07dd041..e06fc89e0 100644 --- a/apps/openmw-mp/Script/Functions/World.cpp +++ b/apps/openmw-mp/Script/Functions/World.cpp @@ -138,12 +138,6 @@ int WorldFunctions::GetContainerItemGoldValue(unsigned int objectIndex, unsigned .containerChanges.items.at(itemIndex).goldValue; } -const char *WorldFunctions::GetContainerItemOwner(unsigned int objectIndex, unsigned int itemIndex) noexcept -{ - return mwmp::Networking::getPtr()->getLastEvent()->objectChanges.objects.at(objectIndex) - .containerChanges.items.at(itemIndex).owner.c_str(); -} - void WorldFunctions::SetBaseEventCell(const char* cellDescription) noexcept { std::string description = cellDescription; diff --git a/apps/openmw-mp/Script/Functions/World.hpp b/apps/openmw-mp/Script/Functions/World.hpp index c05cb310a..9db9c0f4a 100644 --- a/apps/openmw-mp/Script/Functions/World.hpp +++ b/apps/openmw-mp/Script/Functions/World.hpp @@ -27,7 +27,6 @@ {"GetContainerItemCount", WorldFunctions::GetContainerItemCount},\ {"GetContainerItemCharge", WorldFunctions::GetContainerItemCharge},\ {"GetContainerItemGoldValue", WorldFunctions::GetContainerItemGoldValue},\ - {"GetContainerItemOwner", WorldFunctions::GetContainerItemOwner},\ \ {"SetBaseEventCell", WorldFunctions::SetBaseEventCell},\ {"SetBaseEventAction", WorldFunctions::SetBaseEventAction},\ @@ -91,7 +90,6 @@ public: static int GetContainerItemCount(unsigned int objectIndex, unsigned int itemIndex) noexcept; static int GetContainerItemCharge(unsigned int objectIndex, unsigned int itemIndex) noexcept; static int GetContainerItemGoldValue(unsigned int objectIndex, unsigned int itemIndex) noexcept; - static const char *GetContainerItemOwner(unsigned int objectIndex, unsigned int itemIndex) noexcept; static void SetBaseEventCell(const char* cellDescription) noexcept; static void SetBaseEventAction(int action) noexcept; diff --git a/apps/openmw/mwgui/container.cpp b/apps/openmw/mwgui/container.cpp index 1a38e000d..edfca1131 100644 --- a/apps/openmw/mwgui/container.cpp +++ b/apps/openmw/mwgui/container.cpp @@ -117,7 +117,6 @@ namespace MWGui containerItem.count = itemPtr.getRefData().getCount(); containerItem.charge = itemPtr.getCellRef().getCharge(); containerItem.goldValue = itemPtr.getCellRef().getGoldValue(); - containerItem.owner = itemPtr.getCellRef().getOwner(); containerItem.actionCount = count; worldObject.containerChanges.items.push_back(containerItem); @@ -180,7 +179,6 @@ namespace MWGui containerItem.charge = itemPtr.getCellRef().getCharge(); containerItem.goldValue = itemPtr.getCellRef().getGoldValue(); - containerItem.owner = itemPtr.getCellRef().getOwner(); worldObject.containerChanges.items.push_back(containerItem); event->addObject(worldObject); diff --git a/apps/openmw/mwmp/WorldEvent.cpp b/apps/openmw/mwmp/WorldEvent.cpp index 6125c5bf3..a21398ae2 100644 --- a/apps/openmw/mwmp/WorldEvent.cpp +++ b/apps/openmw/mwmp/WorldEvent.cpp @@ -68,7 +68,6 @@ void WorldEvent::sendContainers(MWWorld::CellStore* cellStore) containerItem.count = itemPtr.getRefData().getCount(); containerItem.charge = itemPtr.getCellRef().getCharge(); containerItem.goldValue = itemPtr.getCellRef().getGoldValue(); - containerItem.owner = itemPtr.getCellRef().getOwner(); worldObject.containerChanges.items.push_back(containerItem); } @@ -109,10 +108,7 @@ void WorldEvent::editContainers(MWWorld::CellStore* cellStore) for (unsigned int i = 0; i < worldObject.containerChanges.count; i++) { ContainerItem containerItem = worldObject.containerChanges.items.at(i); - MWWorld::Ptr ownerPtr = MWBase::Environment::get().getWorld()->searchPtr(containerItem.owner, false); - - if (ownerPtr.isEmpty()) - ownerPtr = MWBase::Environment::get().getWorld()->getPlayerPtr(); + MWWorld::Ptr ownerPtr = MWBase::Environment::get().getWorld()->getPlayerPtr(); if (action == BaseEvent::ADD || action == BaseEvent::SET) { @@ -140,8 +136,7 @@ void WorldEvent::editContainers(MWWorld::CellStore* cellStore) { if (iter->getCellRef().getCharge() == containerItem.charge && iter->getCellRef().getGoldValue() == containerItem.goldValue && - iter->getRefData().getCount() == containerItem.count && - iter->getCellRef().getOwner() == containerItem.owner) + iter->getRefData().getCount() == containerItem.count) { containerStore.remove(*iter, containerItem.actionCount, ownerPtr); } diff --git a/components/openmw-mp/Base/BaseEvent.hpp b/components/openmw-mp/Base/BaseEvent.hpp index 094b6cebc..28d4baf16 100644 --- a/components/openmw-mp/Base/BaseEvent.hpp +++ b/components/openmw-mp/Base/BaseEvent.hpp @@ -14,7 +14,6 @@ namespace mwmp int charge; int goldValue; - std::string owner; int actionCount; inline bool operator==(const ContainerItem& rhs) diff --git a/components/openmw-mp/Packets/World/PacketContainer.cpp b/components/openmw-mp/Packets/World/PacketContainer.cpp index 553ce4650..af614a37c 100644 --- a/components/openmw-mp/Packets/World/PacketContainer.cpp +++ b/components/openmw-mp/Packets/World/PacketContainer.cpp @@ -61,7 +61,6 @@ void PacketContainer::Packet(RakNet::BitStream *bs, BaseEvent *event, bool send) RW(containerItem.count, send); RW(containerItem.charge, send); RW(containerItem.goldValue, send); - RW(containerItem.owner, send); RW(containerItem.actionCount, send); if (!send)