diff --git a/apps/openmw-mp/Script/Functions/World.cpp b/apps/openmw-mp/Script/Functions/World.cpp index cd206e214..bd202833e 100644 --- a/apps/openmw-mp/Script/Functions/World.cpp +++ b/apps/openmw-mp/Script/Functions/World.cpp @@ -30,13 +30,13 @@ void WorldFunctions::InitiateEvent(unsigned short pid) noexcept GET_PLAYER(pid, player, ); writeEvent.cell.blank(); - writeEvent.objectChanges.objects.clear(); + writeEvent.worldObjects.clear(); writeEvent.guid = player->guid; } unsigned int WorldFunctions::GetObjectChangesSize() noexcept { - return readEvent->objectChanges.count; + return readEvent->worldObjectCount; } unsigned char WorldFunctions::GetEventAction() noexcept @@ -46,106 +46,106 @@ unsigned char WorldFunctions::GetEventAction() noexcept const char *WorldFunctions::GetObjectRefId(unsigned int i) noexcept { - return readEvent->objectChanges.objects.at(i).refId.c_str(); + return readEvent->worldObjects.at(i).refId.c_str(); } int WorldFunctions::GetObjectRefNumIndex(unsigned int i) noexcept { - return readEvent->objectChanges.objects.at(i).refNumIndex; + return readEvent->worldObjects.at(i).refNumIndex; } int WorldFunctions::GetObjectMpNum(unsigned int i) noexcept { - return readEvent->objectChanges.objects.at(i).mpNum; + return readEvent->worldObjects.at(i).mpNum; } int WorldFunctions::GetObjectCount(unsigned int i) noexcept { - return readEvent->objectChanges.objects.at(i).count; + return readEvent->worldObjects.at(i).count; } int WorldFunctions::GetObjectCharge(unsigned int i) noexcept { - return readEvent->objectChanges.objects.at(i).charge; + return readEvent->worldObjects.at(i).charge; } int WorldFunctions::GetObjectGoldValue(unsigned int i) noexcept { - return readEvent->objectChanges.objects.at(i).goldValue; + return readEvent->worldObjects.at(i).goldValue; } double WorldFunctions::GetObjectScale(unsigned int i) noexcept { - return readEvent->objectChanges.objects.at(i).scale; + return readEvent->worldObjects.at(i).scale; } int WorldFunctions::GetObjectDoorState(unsigned int i) noexcept { - return readEvent->objectChanges.objects.at(i).doorState; + return readEvent->worldObjects.at(i).doorState; } int WorldFunctions::GetObjectLockLevel(unsigned int i) noexcept { - return readEvent->objectChanges.objects.at(i).lockLevel; + return readEvent->worldObjects.at(i).lockLevel; } double WorldFunctions::GetObjectPosX(unsigned int i) noexcept { - return readEvent->objectChanges.objects.at(i).position.pos[0]; + return readEvent->worldObjects.at(i).position.pos[0]; } double WorldFunctions::GetObjectPosY(unsigned int i) noexcept { - return readEvent->objectChanges.objects.at(i).position.pos[1]; + return readEvent->worldObjects.at(i).position.pos[1]; } double WorldFunctions::GetObjectPosZ(unsigned int i) noexcept { - return readEvent->objectChanges.objects.at(i).position.pos[2]; + return readEvent->worldObjects.at(i).position.pos[2]; } double WorldFunctions::GetObjectRotX(unsigned int i) noexcept { - return readEvent->objectChanges.objects.at(i).position.rot[0]; + return readEvent->worldObjects.at(i).position.rot[0]; } double WorldFunctions::GetObjectRotY(unsigned int i) noexcept { - return readEvent->objectChanges.objects.at(i).position.rot[1]; + return readEvent->worldObjects.at(i).position.rot[1]; } double WorldFunctions::GetObjectRotZ(unsigned int i) noexcept { - return readEvent->objectChanges.objects.at(i).position.rot[2]; + return readEvent->worldObjects.at(i).position.rot[2]; } unsigned int WorldFunctions::GetContainerChangesSize(unsigned int objectIndex) noexcept { - return readEvent->objectChanges.objects.at(objectIndex).containerChanges.count; + return readEvent->worldObjects.at(objectIndex).containerItemCount; } const char *WorldFunctions::GetContainerItemRefId(unsigned int objectIndex, unsigned int itemIndex) noexcept { - return readEvent->objectChanges.objects.at(objectIndex) - .containerChanges.items.at(itemIndex).refId.c_str(); + return readEvent->worldObjects.at(objectIndex) + .containerItems.at(itemIndex).refId.c_str(); } int WorldFunctions::GetContainerItemCount(unsigned int objectIndex, unsigned int itemIndex) noexcept { - return readEvent->objectChanges.objects.at(objectIndex) - .containerChanges.items.at(itemIndex).count; + return readEvent->worldObjects.at(objectIndex) + .containerItems.at(itemIndex).count; } int WorldFunctions::GetContainerItemCharge(unsigned int objectIndex, unsigned int itemIndex) noexcept { - return readEvent->objectChanges.objects.at(objectIndex) - .containerChanges.items.at(itemIndex).charge; + return readEvent->worldObjects.at(objectIndex) + .containerItems.at(itemIndex).charge; } int WorldFunctions::GetContainerItemActionCount(unsigned int objectIndex, unsigned int itemIndex) noexcept { - return readEvent->objectChanges.objects.at(objectIndex) - .containerChanges.items.at(itemIndex).actionCount; + return readEvent->worldObjects.at(objectIndex) + .containerItems.at(itemIndex).actionCount; } void WorldFunctions::SetEventCell(const char* cellDescription) noexcept @@ -234,14 +234,14 @@ void WorldFunctions::SetContainerItemCharge(int charge) noexcept void WorldFunctions::AddWorldObject() noexcept { - writeEvent.objectChanges.objects.push_back(tempWorldObject); + writeEvent.worldObjects.push_back(tempWorldObject); tempWorldObject = emptyWorldObject; } void WorldFunctions::AddContainerItem() noexcept { - tempWorldObject.containerChanges.items.push_back(tempContainerItem); + tempWorldObject.containerItems.push_back(tempContainerItem); tempContainerItem = emptyContainerItem; } diff --git a/apps/openmw-mp/WorldProcessor.cpp b/apps/openmw-mp/WorldProcessor.cpp index c1cc60e77..4fdc3ed7d 100644 --- a/apps/openmw-mp/WorldProcessor.cpp +++ b/apps/openmw-mp/WorldProcessor.cpp @@ -29,7 +29,7 @@ bool WorldProcessor::Process(RakNet::Packet &packet, BaseEvent &event) noexcept { // Clear our BaseEvent before loading new data in it event.cell.blank(); - event.objectChanges.objects.clear(); + event.worldObjects.clear(); event.guid = packet.guid; for (auto &processor : processors) diff --git a/apps/openmw-mp/processors/world/ProcessorContainer.hpp b/apps/openmw-mp/processors/world/ProcessorContainer.hpp index b0b8bc804..7dcf614e5 100644 --- a/apps/openmw-mp/processors/world/ProcessorContainer.hpp +++ b/apps/openmw-mp/processors/world/ProcessorContainer.hpp @@ -25,7 +25,7 @@ namespace mwmp // Until we have a timestamp-based system, send packets pertaining to more // than one container (i.e. replies to server requests for container contents) // only to players who have the container's cell loaded - if (event.action == BaseEvent::SET && event.objectChanges.count > 1) + if (event.action == BaseEvent::SET && event.worldObjectCount > 1) { Cell *serverCell = CellController::get()->getCell(&event.cell); diff --git a/apps/openmw-mp/processors/world/ProcessorObjectPlace.hpp b/apps/openmw-mp/processors/world/ProcessorObjectPlace.hpp index 68ceefde5..19a4123ce 100644 --- a/apps/openmw-mp/processors/world/ProcessorObjectPlace.hpp +++ b/apps/openmw-mp/processors/world/ProcessorObjectPlace.hpp @@ -22,9 +22,9 @@ namespace mwmp { LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player.npc.mName.c_str()); - for (unsigned int i = 0; i < event.objectChanges.count; i++) + for (unsigned int i = 0; i < event.worldObjectCount; i++) { - event.objectChanges.objects.at(i).mpNum = mwmp::Networking::getPtr()->incrementMpNum(); + event.worldObjects.at(i).mpNum = mwmp::Networking::getPtr()->incrementMpNum(); } // Send this packet back to the original sender with the mpNum generation from above, diff --git a/apps/openmw/mwgui/container.cpp b/apps/openmw/mwgui/container.cpp index 920f9561a..40741bf7a 100644 --- a/apps/openmw/mwgui/container.cpp +++ b/apps/openmw/mwgui/container.cpp @@ -133,7 +133,7 @@ namespace MWGui containerItem.charge = itemPtr.getCellRef().getCharge(); containerItem.actionCount = count; - worldObject.containerChanges.items.push_back(containerItem); + worldObject.containerItems.push_back(containerItem); worldEvent->addObject(worldObject); mwmp::Main::get().getNetworking()->getWorldPacket(ID_CONTAINER)->setEvent(worldEvent); @@ -197,7 +197,7 @@ namespace MWGui containerItem.charge = itemPtr.getCellRef().getCharge(); - worldObject.containerChanges.items.push_back(containerItem); + worldObject.containerItems.push_back(containerItem); worldEvent->addObject(worldObject); mwmp::Main::get().getNetworking()->getWorldPacket(ID_CONTAINER)->setEvent(worldEvent); diff --git a/apps/openmw/mwmp/WorldEvent.cpp b/apps/openmw/mwmp/WorldEvent.cpp index b93056715..971ca675c 100644 --- a/apps/openmw/mwmp/WorldEvent.cpp +++ b/apps/openmw/mwmp/WorldEvent.cpp @@ -38,22 +38,22 @@ Networking *WorldEvent::getNetworking() void WorldEvent::reset() { cell.blank(); - objectChanges.objects.clear(); + worldObjects.clear(); guid = mwmp::Main::get().getNetworking()->getLocalPlayer()->guid; } void WorldEvent::addObject(WorldObject worldObject) { - objectChanges.objects.push_back(worldObject); + worldObjects.push_back(worldObject); } void WorldEvent::editContainers(MWWorld::CellStore* cellStore) { WorldObject worldObject; - for (unsigned int i = 0; i < objectChanges.count; i++) + for (unsigned int i = 0; i < worldObjectCount; i++) { - worldObject = objectChanges.objects.at(i); + worldObject = worldObjects.at(i); LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i", worldObject.refId.c_str(), worldObject.refNumIndex, worldObject.mpNum); @@ -70,9 +70,9 @@ void WorldEvent::editContainers(MWWorld::CellStore* cellStore) if (action == BaseEvent::SET) containerStore.clear(); - for (unsigned int i = 0; i < worldObject.containerChanges.count; i++) + for (unsigned int i = 0; i < worldObject.containerItemCount; i++) { - ContainerItem containerItem = worldObject.containerChanges.items.at(i); + ContainerItem containerItem = worldObject.containerItems.at(i); MWWorld::Ptr ownerPtr = MWBase::Environment::get().getWorld()->getPlayerPtr(); if (action == BaseEvent::ADD || action == BaseEvent::SET) @@ -127,9 +127,9 @@ void WorldEvent::placeObjects(MWWorld::CellStore* cellStore) { WorldObject worldObject; - for (unsigned int i = 0; i < objectChanges.count; i++) + for (unsigned int i = 0; i < worldObjectCount; i++) { - worldObject = objectChanges.objects.at(i); + worldObject = worldObjects.at(i); LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i\n- charge: %i\n- count: %i", worldObject.refId.c_str(), worldObject.refNumIndex, worldObject.mpNum, worldObject.charge, worldObject.count); @@ -154,9 +154,9 @@ void WorldEvent::deleteObjects(MWWorld::CellStore* cellStore) { WorldObject worldObject; - for (unsigned int i = 0; i < objectChanges.count; i++) + for (unsigned int i = 0; i < worldObjectCount; i++) { - worldObject = objectChanges.objects.at(i); + worldObject = worldObjects.at(i); LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i", worldObject.refId.c_str(), worldObject.refNumIndex, worldObject.mpNum); @@ -176,9 +176,9 @@ void WorldEvent::lockObjects(MWWorld::CellStore* cellStore) { WorldObject worldObject; - for (unsigned int i = 0; i < objectChanges.count; i++) + for (unsigned int i = 0; i < worldObjectCount; i++) { - worldObject = objectChanges.objects.at(i); + worldObject = worldObjects.at(i); LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i", worldObject.refId.c_str(), worldObject.refNumIndex, worldObject.mpNum); @@ -198,9 +198,9 @@ void WorldEvent::unlockObjects(MWWorld::CellStore* cellStore) { WorldObject worldObject; - for (unsigned int i = 0; i < objectChanges.count; i++) + for (unsigned int i = 0; i < worldObjectCount; i++) { - worldObject = objectChanges.objects.at(i); + worldObject = worldObjects.at(i); LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i", worldObject.refId.c_str(), worldObject.refNumIndex, worldObject.mpNum); @@ -220,9 +220,9 @@ void WorldEvent::scaleObjects(MWWorld::CellStore* cellStore) { WorldObject worldObject; - for (unsigned int i = 0; i < objectChanges.count; i++) + for (unsigned int i = 0; i < worldObjectCount; i++) { - worldObject = objectChanges.objects.at(i); + worldObject = worldObjects.at(i); LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i\n- scale: %f", worldObject.refId.c_str(), worldObject.refNumIndex, worldObject.mpNum, worldObject.scale); @@ -243,9 +243,9 @@ void WorldEvent::moveObjects(MWWorld::CellStore* cellStore) { WorldObject worldObject; - for (unsigned int i = 0; i < objectChanges.count; i++) + for (unsigned int i = 0; i < worldObjectCount; i++) { - worldObject = objectChanges.objects.at(i); + worldObject = worldObjects.at(i); LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i", worldObject.refId.c_str(), worldObject.refNumIndex, worldObject.mpNum); @@ -266,9 +266,9 @@ void WorldEvent::rotateObjects(MWWorld::CellStore* cellStore) { WorldObject worldObject; - for (unsigned int i = 0; i < objectChanges.count; i++) + for (unsigned int i = 0; i < worldObjectCount; i++) { - worldObject = objectChanges.objects.at(i); + worldObject = worldObjects.at(i); LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i", worldObject.refId.c_str(), worldObject.refNumIndex, worldObject.mpNum); @@ -289,9 +289,9 @@ void WorldEvent::animateObjects(MWWorld::CellStore* cellStore) { WorldObject worldObject; - for (unsigned int i = 0; i < objectChanges.count; i++) + for (unsigned int i = 0; i < worldObjectCount; i++) { - worldObject = objectChanges.objects.at(i); + worldObject = worldObjects.at(i); LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i", worldObject.refId.c_str(), worldObject.refNumIndex, worldObject.mpNum); @@ -313,9 +313,9 @@ void WorldEvent::activateDoors(MWWorld::CellStore* cellStore) { WorldObject worldObject; - for (unsigned int i = 0; i < objectChanges.count; i++) + for (unsigned int i = 0; i < worldObjectCount; i++) { - worldObject = objectChanges.objects.at(i); + worldObject = worldObjects.at(i); LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i", worldObject.refId.c_str(), worldObject.refNumIndex, worldObject.mpNum); @@ -336,9 +336,9 @@ void WorldEvent::setLocalShorts(MWWorld::CellStore* cellStore) { WorldObject worldObject; - for (unsigned int i = 0; i < objectChanges.count; i++) + for (unsigned int i = 0; i < worldObjectCount; i++) { - worldObject = objectChanges.objects.at(i); + worldObject = worldObjects.at(i); LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i\n- index: %i\n- shortVal: %i", worldObject.refId.c_str(), worldObject.refNumIndex, worldObject.mpNum, worldObject.index, worldObject.shortVal); @@ -359,9 +359,9 @@ void WorldEvent::setLocalFloats(MWWorld::CellStore* cellStore) { WorldObject worldObject; - for (unsigned int i = 0; i < objectChanges.count; i++) + for (unsigned int i = 0; i < worldObjectCount; i++) { - worldObject = objectChanges.objects.at(i); + worldObject = worldObjects.at(i); LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i, %i\n- index: %i\n- floatVal: %f", worldObject.refId.c_str(), worldObject.refNumIndex, worldObject.mpNum, worldObject.index, worldObject.floatVal); @@ -382,9 +382,9 @@ void WorldEvent::setMemberShorts() { WorldObject worldObject; - for (unsigned int i = 0; i < objectChanges.count; i++) + for (unsigned int i = 0; i < worldObjectCount; i++) { - worldObject = objectChanges.objects.at(i); + worldObject = worldObjects.at(i); LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s\n- index: %i\n- shortVal: %i\n", worldObject.refId.c_str(), worldObject.index, worldObject.shortVal); @@ -411,9 +411,9 @@ void WorldEvent::setGlobalShorts() { WorldObject worldObject; - for (unsigned int i = 0; i < objectChanges.count; i++) + for (unsigned int i = 0; i < worldObjectCount; i++) { - worldObject = objectChanges.objects.at(i); + worldObject = worldObjects.at(i); LOG_APPEND(Log::LOG_VERBOSE, "- varName: %s\n- shortVal: %i", worldObject.varName.c_str(), worldObject.shortVal); @@ -425,9 +425,9 @@ void WorldEvent::playMusic() { WorldObject worldObject; - for (unsigned int i = 0; i < objectChanges.count; i++) + for (unsigned int i = 0; i < worldObjectCount; i++) { - worldObject = objectChanges.objects.at(i); + worldObject = worldObjects.at(i); LOG_APPEND(Log::LOG_VERBOSE, "- filename: %s", worldObject.filename.c_str()); @@ -439,9 +439,9 @@ void WorldEvent::playVideo() { WorldObject worldObject; - for (unsigned int i = 0; i < objectChanges.count; i++) + for (unsigned int i = 0; i < worldObjectCount; i++) { - worldObject = objectChanges.objects.at(i); + worldObject = worldObjects.at(i); LOG_APPEND(Log::LOG_VERBOSE, "- filename: %s\n- allowSkipping: %s", worldObject.filename.c_str(), worldObject.allowSkipping ? "true" : "false"); @@ -607,7 +607,7 @@ void WorldEvent::sendObjectPlace() { LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Sending ID_OBJECT_PLACE about %s", cell.getDescription().c_str()); - for (std::vector::iterator it = objectChanges.objects.begin(); it != objectChanges.objects.end(); ++it) + for (std::vector::iterator it = worldObjects.begin(); it != worldObjects.end(); ++it) { mwmp::WorldObject worldObject = (*it); @@ -653,7 +653,7 @@ void WorldEvent::sendDoorState() { LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Sending ID_DOOR_STATE about %s", cell.getDescription().c_str()); - for (std::vector::iterator it = objectChanges.objects.begin(); it != objectChanges.objects.end(); ++it) + for (std::vector::iterator it = worldObjects.begin(); it != worldObjects.end(); ++it) { mwmp::WorldObject worldObject = (*it); @@ -681,7 +681,7 @@ void WorldEvent::sendScriptLocalShort() { LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Sending ID_SCRIPT_LOCAL_SHORT about %s", cell.getDescription().c_str()); - for (std::vector::iterator it = objectChanges.objects.begin(); it != objectChanges.objects.end(); ++it) + for (std::vector::iterator it = worldObjects.begin(); it != worldObjects.end(); ++it) { mwmp::WorldObject worldObject = (*it); @@ -697,7 +697,7 @@ void WorldEvent::sendScriptLocalFloat() { LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Sending ID_SCRIPT_LOCAL_FLOAT about %s", cell.getDescription().c_str()); - for (std::vector::iterator it = objectChanges.objects.begin(); it != objectChanges.objects.end(); ++it) + for (std::vector::iterator it = worldObjects.begin(); it != worldObjects.end(); ++it) { mwmp::WorldObject worldObject = (*it); @@ -713,7 +713,7 @@ void WorldEvent::sendScriptMemberShort() { LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Sending ID_SCRIPT_MEMBER_SHORT"); - for (std::vector::iterator it = objectChanges.objects.begin(); it != objectChanges.objects.end(); ++it) + for (std::vector::iterator it = worldObjects.begin(); it != worldObjects.end(); ++it) { mwmp::WorldObject worldObject = (*it); @@ -729,7 +729,7 @@ void WorldEvent::sendScriptGlobalShort() { LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Sending ID_SCRIPT_GLOBAL_SHORT"); - for (std::vector::iterator it = objectChanges.objects.begin(); it != objectChanges.objects.end(); ++it) + for (std::vector::iterator it = worldObjects.begin(); it != worldObjects.end(); ++it) { mwmp::WorldObject worldObject = (*it); @@ -770,7 +770,7 @@ void WorldEvent::sendContainers(MWWorld::CellStore* cellStore) containerItem.count = itemPtr.getRefData().getCount(); containerItem.charge = itemPtr.getCellRef().getCharge(); - worldObject.containerChanges.items.push_back(containerItem); + worldObject.containerItems.push_back(containerItem); } addObject(worldObject); diff --git a/components/openmw-mp/Base/BaseEvent.hpp b/components/openmw-mp/Base/BaseEvent.hpp index f7c60f52a..e13ce77ca 100644 --- a/components/openmw-mp/Base/BaseEvent.hpp +++ b/components/openmw-mp/Base/BaseEvent.hpp @@ -21,12 +21,6 @@ namespace mwmp } }; - struct ContainerChanges - { - std::vector items; - unsigned int count; - }; - struct WorldObject { std::string refId; @@ -53,13 +47,8 @@ namespace mwmp float floatVal; std::string varName; - ContainerChanges containerChanges; - }; - - struct ObjectChanges - { - std::vector objects; - unsigned int count; + std::vector containerItems; + unsigned int containerItemCount; }; class BaseEvent @@ -85,7 +74,9 @@ namespace mwmp }; RakNet::RakNetGUID guid; - ObjectChanges objectChanges; + + std::vector worldObjects; + unsigned int worldObjectCount; ESM::Cell cell; diff --git a/components/openmw-mp/Packets/World/PacketContainer.cpp b/components/openmw-mp/Packets/World/PacketContainer.cpp index 65729f326..257e3c699 100644 --- a/components/openmw-mp/Packets/World/PacketContainer.cpp +++ b/components/openmw-mp/Packets/World/PacketContainer.cpp @@ -16,14 +16,14 @@ void PacketContainer::Packet(RakNet::BitStream *bs, bool send) if (send) { - event->objectChanges.count = (unsigned int)(event->objectChanges.objects.size()); + event->worldObjectCount = (unsigned int)(event->worldObjects.size()); } else { - event->objectChanges.objects.clear(); + event->worldObjects.clear(); } - RW(event->objectChanges.count, send); + RW(event->worldObjectCount, send); RW(event->cell.mData.mFlags, send); RW(event->cell.mData.mX, send); @@ -32,30 +32,30 @@ void PacketContainer::Packet(RakNet::BitStream *bs, bool send) WorldObject worldObject; - for (unsigned int i = 0; i < event->objectChanges.count; i++) + for (unsigned int i = 0; i < event->worldObjectCount; i++) { if (send) { - worldObject = event->objectChanges.objects.at(i); - worldObject.containerChanges.count = (unsigned int)(worldObject.containerChanges.items.size()); + worldObject = event->worldObjects.at(i); + worldObject.containerItemCount = (unsigned int)(worldObject.containerItems.size()); } else { - worldObject.containerChanges.items.clear(); + worldObject.containerItems.clear(); } RW(worldObject.refId, send); RW(worldObject.refNumIndex, send); RW(worldObject.mpNum, send); - RW(worldObject.containerChanges.count, send); + RW(worldObject.containerItemCount, send); ContainerItem containerItem; - for (unsigned int i = 0; i < worldObject.containerChanges.count; i++) + for (unsigned int i = 0; i < worldObject.containerItemCount; i++) { if (send) { - containerItem = worldObject.containerChanges.items.at(i); + containerItem = worldObject.containerItems.at(i); } RW(containerItem.refId, send); @@ -65,13 +65,13 @@ void PacketContainer::Packet(RakNet::BitStream *bs, bool send) if (!send) { - worldObject.containerChanges.items.push_back(containerItem); + worldObject.containerItems.push_back(containerItem); } } if (!send) { - event->objectChanges.objects.push_back(worldObject); + event->worldObjects.push_back(worldObject); } } } diff --git a/components/openmw-mp/Packets/World/PacketDoorState.cpp b/components/openmw-mp/Packets/World/PacketDoorState.cpp index 3d981ebcd..f513e8de5 100644 --- a/components/openmw-mp/Packets/World/PacketDoorState.cpp +++ b/components/openmw-mp/Packets/World/PacketDoorState.cpp @@ -13,11 +13,11 @@ void PacketDoorState::Packet(RakNet::BitStream *bs, bool send) WorldPacket::Packet(bs, send); if (!send) - event->objectChanges.objects.clear(); + event->worldObjects.clear(); else - event->objectChanges.count = (unsigned int)(event->objectChanges.objects.size()); + event->worldObjectCount = (unsigned int)(event->worldObjects.size()); - RW(event->objectChanges.count, send); + RW(event->worldObjectCount, send); RW(event->cell.mData.mFlags, send); RW(event->cell.mData.mX, send); @@ -26,11 +26,11 @@ void PacketDoorState::Packet(RakNet::BitStream *bs, bool send) WorldObject worldObject; - for (unsigned int i = 0; i < event->objectChanges.count; i++) + for (unsigned int i = 0; i < event->worldObjectCount; i++) { if (send) { - worldObject = event->objectChanges.objects.at(i); + worldObject = event->worldObjects.at(i); } RW(worldObject.refId, send); @@ -40,7 +40,7 @@ void PacketDoorState::Packet(RakNet::BitStream *bs, bool send) if (!send) { - event->objectChanges.objects.push_back(worldObject); + event->worldObjects.push_back(worldObject); } } } diff --git a/components/openmw-mp/Packets/World/PacketMusicPlay.cpp b/components/openmw-mp/Packets/World/PacketMusicPlay.cpp index 80ba03826..c69531995 100644 --- a/components/openmw-mp/Packets/World/PacketMusicPlay.cpp +++ b/components/openmw-mp/Packets/World/PacketMusicPlay.cpp @@ -13,26 +13,26 @@ void PacketMusicPlay::Packet(RakNet::BitStream *bs, bool send) WorldPacket::Packet(bs, send); if (!send) - event->objectChanges.objects.clear(); + event->worldObjects.clear(); else - event->objectChanges.count = (unsigned int)(event->objectChanges.objects.size()); + event->worldObjectCount = (unsigned int)(event->worldObjects.size()); - RW(event->objectChanges.count, send); + RW(event->worldObjectCount, send); WorldObject worldObject; - for (unsigned int i = 0; i < event->objectChanges.count; i++) + for (unsigned int i = 0; i < event->worldObjectCount; i++) { if (send) { - worldObject = event->objectChanges.objects.at(i); + worldObject = event->worldObjects.at(i); } RW(worldObject.filename, send); if (!send) { - event->objectChanges.objects.push_back(worldObject); + event->worldObjects.push_back(worldObject); } } } diff --git a/components/openmw-mp/Packets/World/PacketObjectAnimPlay.cpp b/components/openmw-mp/Packets/World/PacketObjectAnimPlay.cpp index f64fb32e3..fd828ecb8 100644 --- a/components/openmw-mp/Packets/World/PacketObjectAnimPlay.cpp +++ b/components/openmw-mp/Packets/World/PacketObjectAnimPlay.cpp @@ -13,11 +13,11 @@ void PacketObjectAnimPlay::Packet(RakNet::BitStream *bs, bool send) WorldPacket::Packet(bs, send); if (!send) - event->objectChanges.objects.clear(); + event->worldObjects.clear(); else - event->objectChanges.count = (unsigned int)(event->objectChanges.objects.size()); + event->worldObjectCount = (unsigned int)(event->worldObjects.size()); - RW(event->objectChanges.count, send); + RW(event->worldObjectCount, send); RW(event->cell.mData.mFlags, send); RW(event->cell.mData.mX, send); @@ -26,11 +26,11 @@ void PacketObjectAnimPlay::Packet(RakNet::BitStream *bs, bool send) WorldObject worldObject; - for (unsigned int i = 0; i < event->objectChanges.count; i++) + for (unsigned int i = 0; i < event->worldObjectCount; i++) { if (send) { - worldObject = event->objectChanges.objects.at(i); + worldObject = event->worldObjects.at(i); } RW(worldObject.refId, send); @@ -41,7 +41,7 @@ void PacketObjectAnimPlay::Packet(RakNet::BitStream *bs, bool send) if (!send) { - event->objectChanges.objects.push_back(worldObject); + event->worldObjects.push_back(worldObject); } } } diff --git a/components/openmw-mp/Packets/World/PacketObjectDelete.cpp b/components/openmw-mp/Packets/World/PacketObjectDelete.cpp index 260f707e5..c333b63ac 100644 --- a/components/openmw-mp/Packets/World/PacketObjectDelete.cpp +++ b/components/openmw-mp/Packets/World/PacketObjectDelete.cpp @@ -13,11 +13,11 @@ void PacketObjectDelete::Packet(RakNet::BitStream *bs, bool send) WorldPacket::Packet(bs, send); if (!send) - event->objectChanges.objects.clear(); + event->worldObjects.clear(); else - event->objectChanges.count = (unsigned int)(event->objectChanges.objects.size()); + event->worldObjectCount = (unsigned int)(event->worldObjects.size()); - RW(event->objectChanges.count, send); + RW(event->worldObjectCount, send); RW(event->cell.mData.mFlags, send); RW(event->cell.mData.mX, send); @@ -26,11 +26,11 @@ void PacketObjectDelete::Packet(RakNet::BitStream *bs, bool send) WorldObject worldObject; - for (unsigned int i = 0; i < event->objectChanges.count; i++) + for (unsigned int i = 0; i < event->worldObjectCount; i++) { if (send) { - worldObject = event->objectChanges.objects.at(i); + worldObject = event->worldObjects.at(i); } RW(worldObject.refId, send); @@ -39,7 +39,7 @@ void PacketObjectDelete::Packet(RakNet::BitStream *bs, bool send) if (!send) { - event->objectChanges.objects.push_back(worldObject); + event->worldObjects.push_back(worldObject); } } } diff --git a/components/openmw-mp/Packets/World/PacketObjectLock.cpp b/components/openmw-mp/Packets/World/PacketObjectLock.cpp index 7a1ff5c80..6f27ee63b 100644 --- a/components/openmw-mp/Packets/World/PacketObjectLock.cpp +++ b/components/openmw-mp/Packets/World/PacketObjectLock.cpp @@ -13,11 +13,11 @@ void PacketObjectLock::Packet(RakNet::BitStream *bs, bool send) WorldPacket::Packet(bs, send); if (!send) - event->objectChanges.objects.clear(); + event->worldObjects.clear(); else - event->objectChanges.count = (unsigned int)(event->objectChanges.objects.size()); + event->worldObjectCount = (unsigned int)(event->worldObjects.size()); - RW(event->objectChanges.count, send); + RW(event->worldObjectCount, send); RW(event->cell.mData.mFlags, send); RW(event->cell.mData.mX, send); @@ -26,11 +26,11 @@ void PacketObjectLock::Packet(RakNet::BitStream *bs, bool send) WorldObject worldObject; - for (unsigned int i = 0; i < event->objectChanges.count; i++) + for (unsigned int i = 0; i < event->worldObjectCount; i++) { if (send) { - worldObject = event->objectChanges.objects.at(i); + worldObject = event->worldObjects.at(i); } RW(worldObject.refId, send); @@ -40,7 +40,7 @@ void PacketObjectLock::Packet(RakNet::BitStream *bs, bool send) if (!send) { - event->objectChanges.objects.push_back(worldObject); + event->worldObjects.push_back(worldObject); } } } diff --git a/components/openmw-mp/Packets/World/PacketObjectMove.cpp b/components/openmw-mp/Packets/World/PacketObjectMove.cpp index 9d395a6fb..8d1015629 100644 --- a/components/openmw-mp/Packets/World/PacketObjectMove.cpp +++ b/components/openmw-mp/Packets/World/PacketObjectMove.cpp @@ -13,11 +13,11 @@ void PacketObjectMove::Packet(RakNet::BitStream *bs, bool send) WorldPacket::Packet(bs, send); if (!send) - event->objectChanges.objects.clear(); + event->worldObjects.clear(); else - event->objectChanges.count = (unsigned int)(event->objectChanges.objects.size()); + event->worldObjectCount = (unsigned int)(event->worldObjects.size()); - RW(event->objectChanges.count, send); + RW(event->worldObjectCount, send); RW(event->cell.mData.mFlags, send); RW(event->cell.mData.mX, send); @@ -26,11 +26,11 @@ void PacketObjectMove::Packet(RakNet::BitStream *bs, bool send) WorldObject worldObject; - for (unsigned int i = 0; i < event->objectChanges.count; i++) + for (unsigned int i = 0; i < event->worldObjectCount; i++) { if (send) { - worldObject = event->objectChanges.objects.at(i); + worldObject = event->worldObjects.at(i); } RW(worldObject.refId, send); @@ -42,7 +42,7 @@ void PacketObjectMove::Packet(RakNet::BitStream *bs, bool send) if (!send) { - event->objectChanges.objects.push_back(worldObject); + event->worldObjects.push_back(worldObject); } } } diff --git a/components/openmw-mp/Packets/World/PacketObjectPlace.cpp b/components/openmw-mp/Packets/World/PacketObjectPlace.cpp index 07b8cb1dc..7a0be6428 100644 --- a/components/openmw-mp/Packets/World/PacketObjectPlace.cpp +++ b/components/openmw-mp/Packets/World/PacketObjectPlace.cpp @@ -13,11 +13,11 @@ void PacketObjectPlace::Packet(RakNet::BitStream *bs, bool send) WorldPacket::Packet(bs, send); if (!send) - event->objectChanges.objects.clear(); + event->worldObjects.clear(); else - event->objectChanges.count = (unsigned int)(event->objectChanges.objects.size()); + event->worldObjectCount = (unsigned int)(event->worldObjects.size()); - RW(event->objectChanges.count, send); + RW(event->worldObjectCount, send); RW(event->cell.mData.mFlags, send); RW(event->cell.mData.mX, send); @@ -26,11 +26,11 @@ void PacketObjectPlace::Packet(RakNet::BitStream *bs, bool send) WorldObject worldObject; - for (unsigned int i = 0; i < event->objectChanges.count; i++) + for (unsigned int i = 0; i < event->worldObjectCount; i++) { if (send) { - worldObject = event->objectChanges.objects.at(i); + worldObject = event->worldObjects.at(i); } RW(worldObject.refId, send); @@ -43,7 +43,7 @@ void PacketObjectPlace::Packet(RakNet::BitStream *bs, bool send) if (!send) { - event->objectChanges.objects.push_back(worldObject); + event->worldObjects.push_back(worldObject); } } } diff --git a/components/openmw-mp/Packets/World/PacketObjectRotate.cpp b/components/openmw-mp/Packets/World/PacketObjectRotate.cpp index 3c0e6b79c..9d14f42e9 100644 --- a/components/openmw-mp/Packets/World/PacketObjectRotate.cpp +++ b/components/openmw-mp/Packets/World/PacketObjectRotate.cpp @@ -13,11 +13,11 @@ void PacketObjectRotate::Packet(RakNet::BitStream *bs, bool send) WorldPacket::Packet(bs, send); if (!send) - event->objectChanges.objects.clear(); + event->worldObjects.clear(); else - event->objectChanges.count = (unsigned int)(event->objectChanges.objects.size()); + event->worldObjectCount = (unsigned int)(event->worldObjects.size()); - RW(event->objectChanges.count, send); + RW(event->worldObjectCount, send); RW(event->cell.mData.mFlags, send); RW(event->cell.mData.mX, send); @@ -26,11 +26,11 @@ void PacketObjectRotate::Packet(RakNet::BitStream *bs, bool send) WorldObject worldObject; - for (unsigned int i = 0; i < event->objectChanges.count; i++) + for (unsigned int i = 0; i < event->worldObjectCount; i++) { if (send) { - worldObject = event->objectChanges.objects.at(i); + worldObject = event->worldObjects.at(i); } RW(worldObject.refId, send); @@ -42,7 +42,7 @@ void PacketObjectRotate::Packet(RakNet::BitStream *bs, bool send) if (!send) { - event->objectChanges.objects.push_back(worldObject); + event->worldObjects.push_back(worldObject); } } } diff --git a/components/openmw-mp/Packets/World/PacketObjectScale.cpp b/components/openmw-mp/Packets/World/PacketObjectScale.cpp index bf77dd7de..0ba4d9461 100644 --- a/components/openmw-mp/Packets/World/PacketObjectScale.cpp +++ b/components/openmw-mp/Packets/World/PacketObjectScale.cpp @@ -13,11 +13,11 @@ void PacketObjectScale::Packet(RakNet::BitStream *bs, bool send) WorldPacket::Packet(bs, send); if (!send) - event->objectChanges.objects.clear(); + event->worldObjects.clear(); else - event->objectChanges.count = (unsigned int)(event->objectChanges.objects.size()); + event->worldObjectCount = (unsigned int)(event->worldObjects.size()); - RW(event->objectChanges.count, send); + RW(event->worldObjectCount, send); RW(event->cell.mData.mFlags, send); RW(event->cell.mData.mX, send); @@ -26,11 +26,11 @@ void PacketObjectScale::Packet(RakNet::BitStream *bs, bool send) WorldObject worldObject; - for (unsigned int i = 0; i < event->objectChanges.count; i++) + for (unsigned int i = 0; i < event->worldObjectCount; i++) { if (send) { - worldObject = event->objectChanges.objects.at(i); + worldObject = event->worldObjects.at(i); } RW(worldObject.refId, send); @@ -40,7 +40,7 @@ void PacketObjectScale::Packet(RakNet::BitStream *bs, bool send) if (!send) { - event->objectChanges.objects.push_back(worldObject); + event->worldObjects.push_back(worldObject); } } } diff --git a/components/openmw-mp/Packets/World/PacketObjectUnlock.cpp b/components/openmw-mp/Packets/World/PacketObjectUnlock.cpp index 2683b0340..d4d405538 100644 --- a/components/openmw-mp/Packets/World/PacketObjectUnlock.cpp +++ b/components/openmw-mp/Packets/World/PacketObjectUnlock.cpp @@ -13,11 +13,11 @@ void PacketObjectUnlock::Packet(RakNet::BitStream *bs, bool send) WorldPacket::Packet(bs, send); if (!send) - event->objectChanges.objects.clear(); + event->worldObjects.clear(); else - event->objectChanges.count = (unsigned int)(event->objectChanges.objects.size()); + event->worldObjectCount = (unsigned int)(event->worldObjects.size()); - RW(event->objectChanges.count, send); + RW(event->worldObjectCount, send); RW(event->cell.mData.mFlags, send); RW(event->cell.mData.mX, send); @@ -26,11 +26,11 @@ void PacketObjectUnlock::Packet(RakNet::BitStream *bs, bool send) WorldObject worldObject; - for (unsigned int i = 0; i < event->objectChanges.count; i++) + for (unsigned int i = 0; i < event->worldObjectCount; i++) { if (send) { - worldObject = event->objectChanges.objects.at(i); + worldObject = event->worldObjects.at(i); } RW(worldObject.refId, send); @@ -39,7 +39,7 @@ void PacketObjectUnlock::Packet(RakNet::BitStream *bs, bool send) if (!send) { - event->objectChanges.objects.push_back(worldObject); + event->worldObjects.push_back(worldObject); } } } diff --git a/components/openmw-mp/Packets/World/PacketScriptGlobalShort.cpp b/components/openmw-mp/Packets/World/PacketScriptGlobalShort.cpp index 56f2a57e4..764dfc0a0 100644 --- a/components/openmw-mp/Packets/World/PacketScriptGlobalShort.cpp +++ b/components/openmw-mp/Packets/World/PacketScriptGlobalShort.cpp @@ -13,19 +13,19 @@ void PacketScriptGlobalShort::Packet(RakNet::BitStream *bs, bool send) WorldPacket::Packet(bs, send); if (!send) - event->objectChanges.objects.clear(); + event->worldObjects.clear(); else - event->objectChanges.count = (unsigned int)(event->objectChanges.objects.size()); + event->worldObjectCount = (unsigned int)(event->worldObjects.size()); - RW(event->objectChanges.count, send); + RW(event->worldObjectCount, send); WorldObject worldObject; - for (unsigned int i = 0; i < event->objectChanges.count; i++) + for (unsigned int i = 0; i < event->worldObjectCount; i++) { if (send) { - worldObject = event->objectChanges.objects.at(i); + worldObject = event->worldObjects.at(i); } RW(worldObject.varName, send); @@ -33,7 +33,7 @@ void PacketScriptGlobalShort::Packet(RakNet::BitStream *bs, bool send) if (!send) { - event->objectChanges.objects.push_back(worldObject); + event->worldObjects.push_back(worldObject); } } } diff --git a/components/openmw-mp/Packets/World/PacketScriptLocalFloat.cpp b/components/openmw-mp/Packets/World/PacketScriptLocalFloat.cpp index c90e719f7..b0001b328 100644 --- a/components/openmw-mp/Packets/World/PacketScriptLocalFloat.cpp +++ b/components/openmw-mp/Packets/World/PacketScriptLocalFloat.cpp @@ -13,11 +13,11 @@ void PacketScriptLocalFloat::Packet(RakNet::BitStream *bs, bool send) WorldPacket::Packet(bs, send); if (!send) - event->objectChanges.objects.clear(); + event->worldObjects.clear(); else - event->objectChanges.count = (unsigned int)(event->objectChanges.objects.size()); + event->worldObjectCount = (unsigned int)(event->worldObjects.size()); - RW(event->objectChanges.count, send); + RW(event->worldObjectCount, send); RW(event->cell.mData.mFlags, send); RW(event->cell.mData.mX, send); @@ -26,11 +26,11 @@ void PacketScriptLocalFloat::Packet(RakNet::BitStream *bs, bool send) WorldObject worldObject; - for (unsigned int i = 0; i < event->objectChanges.count; i++) + for (unsigned int i = 0; i < event->worldObjectCount; i++) { if (send) { - worldObject = event->objectChanges.objects.at(i); + worldObject = event->worldObjects.at(i); } RW(worldObject.refId, send); @@ -41,7 +41,7 @@ void PacketScriptLocalFloat::Packet(RakNet::BitStream *bs, bool send) if (!send) { - event->objectChanges.objects.push_back(worldObject); + event->worldObjects.push_back(worldObject); } } } diff --git a/components/openmw-mp/Packets/World/PacketScriptLocalShort.cpp b/components/openmw-mp/Packets/World/PacketScriptLocalShort.cpp index 0e4c6104a..a3b18e494 100644 --- a/components/openmw-mp/Packets/World/PacketScriptLocalShort.cpp +++ b/components/openmw-mp/Packets/World/PacketScriptLocalShort.cpp @@ -13,11 +13,11 @@ void PacketScriptLocalShort::Packet(RakNet::BitStream *bs, bool send) WorldPacket::Packet(bs, send); if (!send) - event->objectChanges.objects.clear(); + event->worldObjects.clear(); else - event->objectChanges.count = (unsigned int)(event->objectChanges.objects.size()); + event->worldObjectCount = (unsigned int)(event->worldObjects.size()); - RW(event->objectChanges.count, send); + RW(event->worldObjectCount, send); RW(event->cell.mData.mFlags, send); RW(event->cell.mData.mX, send); @@ -26,11 +26,11 @@ void PacketScriptLocalShort::Packet(RakNet::BitStream *bs, bool send) WorldObject worldObject; - for (unsigned int i = 0; i < event->objectChanges.count; i++) + for (unsigned int i = 0; i < event->worldObjectCount; i++) { if (send) { - worldObject = event->objectChanges.objects.at(i); + worldObject = event->worldObjects.at(i); } RW(worldObject.refId, send); @@ -41,7 +41,7 @@ void PacketScriptLocalShort::Packet(RakNet::BitStream *bs, bool send) if (!send) { - event->objectChanges.objects.push_back(worldObject); + event->worldObjects.push_back(worldObject); } } } diff --git a/components/openmw-mp/Packets/World/PacketScriptMemberShort.cpp b/components/openmw-mp/Packets/World/PacketScriptMemberShort.cpp index 72803b271..54116ded5 100644 --- a/components/openmw-mp/Packets/World/PacketScriptMemberShort.cpp +++ b/components/openmw-mp/Packets/World/PacketScriptMemberShort.cpp @@ -13,19 +13,19 @@ void PacketScriptMemberShort::Packet(RakNet::BitStream *bs, bool send) WorldPacket::Packet(bs, send); if (!send) - event->objectChanges.objects.clear(); + event->worldObjects.clear(); else - event->objectChanges.count = (unsigned int)(event->objectChanges.objects.size()); + event->worldObjectCount = (unsigned int)(event->worldObjects.size()); - RW(event->objectChanges.count, send); + RW(event->worldObjectCount, send); WorldObject worldObject; - for (unsigned int i = 0; i < event->objectChanges.count; i++) + for (unsigned int i = 0; i < event->worldObjectCount; i++) { if (send) { - worldObject = event->objectChanges.objects.at(i); + worldObject = event->worldObjects.at(i); } RW(worldObject.refId, send); @@ -34,7 +34,7 @@ void PacketScriptMemberShort::Packet(RakNet::BitStream *bs, bool send) if (!send) { - event->objectChanges.objects.push_back(worldObject); + event->worldObjects.push_back(worldObject); } } } diff --git a/components/openmw-mp/Packets/World/PacketVideoPlay.cpp b/components/openmw-mp/Packets/World/PacketVideoPlay.cpp index 2b5e212ee..3458ddc6d 100644 --- a/components/openmw-mp/Packets/World/PacketVideoPlay.cpp +++ b/components/openmw-mp/Packets/World/PacketVideoPlay.cpp @@ -13,19 +13,19 @@ void PacketVideoPlay::Packet(RakNet::BitStream *bs, bool send) WorldPacket::Packet(bs, send); if (!send) - event->objectChanges.objects.clear(); + event->worldObjects.clear(); else - event->objectChanges.count = (unsigned int)(event->objectChanges.objects.size()); + event->worldObjectCount = (unsigned int)(event->worldObjects.size()); - RW(event->objectChanges.count, send); + RW(event->worldObjectCount, send); WorldObject worldObject; - for (unsigned int i = 0; i < event->objectChanges.count; i++) + for (unsigned int i = 0; i < event->worldObjectCount; i++) { if (send) { - worldObject = event->objectChanges.objects.at(i); + worldObject = event->worldObjects.at(i); } RW(worldObject.filename, send); @@ -33,7 +33,7 @@ void PacketVideoPlay::Packet(RakNet::BitStream *bs, bool send) if (!send) { - event->objectChanges.objects.push_back(worldObject); + event->worldObjects.push_back(worldObject); } } }