diff --git a/components/openmw-mp/Packets/Actor/PacketActorCellChange.cpp b/components/openmw-mp/Packets/Actor/PacketActorCellChange.cpp index 5cfb7db90..077674334 100644 --- a/components/openmw-mp/Packets/Actor/PacketActorCellChange.cpp +++ b/components/openmw-mp/Packets/Actor/PacketActorCellChange.cpp @@ -31,9 +31,7 @@ void PacketActorCellChange::Packet(RakNet::BitStream *bs, bool send) for (unsigned int i = 0; i < actorList->count; i++) { if (send) - { actor = actorList->baseActors.at(i); - } RW(actor.refNumIndex, send); RW(actor.mpNum, send); @@ -45,8 +43,6 @@ void PacketActorCellChange::Packet(RakNet::BitStream *bs, bool send) RW(actor.direction, send, 1); if (!send) - { actorList->baseActors.push_back(actor); - } } } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerAttack.cpp b/components/openmw-mp/Packets/Player/PacketPlayerAttack.cpp index c1c2cd94d..bde2c9d0c 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerAttack.cpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerAttack.cpp @@ -16,15 +16,15 @@ void PacketPlayerAttack::Packet(RakNet::BitStream *bs, bool send) { PlayerPacket::Packet(bs, send); - RW(player->attack.target.refId, send); + RW(player->attack.target.refId, send, 1); RW(player->attack.target.refNumIndex, send); RW(player->attack.target.mpNum, send); RW(player->attack.target.guid, send); - RW(player->attack.spellId, send); + RW(player->attack.spellId, send, 1); RW(player->attack.type, send); RW(player->attack.success, send); - RW(player->attack.damage, send); + RW(player->attack.damage, send, 0); // never compress damage RW(player->attack.pressed, send); RW(player->attack.knockdown, send); diff --git a/components/openmw-mp/Packets/Player/PacketPlayerAttribute.cpp b/components/openmw-mp/Packets/Player/PacketPlayerAttribute.cpp index 1de941dc1..bdab8abe5 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerAttribute.cpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerAttribute.cpp @@ -16,6 +16,5 @@ void PacketPlayerAttribute::Packet(RakNet::BitStream *bs, bool send) { PlayerPacket::Packet(bs, send); - for (int i = 0; i < AttributeCount; ++i) - RW(player->creatureStats.mAttributes[i], send); + RW(player->creatureStats.mAttributes, send); } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerBaseInfo.cpp b/components/openmw-mp/Packets/Player/PacketPlayerBaseInfo.cpp index 4df7e368e..d17181a63 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerBaseInfo.cpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerBaseInfo.cpp @@ -16,16 +16,16 @@ void PacketPlayerBaseInfo::Packet(RakNet::BitStream *bs, bool send) { PlayerPacket::Packet(bs, send); - RW(player->npc.mName, send); - RW(player->npc.mModel, send); - RW(player->npc.mRace, send); - RW(player->npc.mHair, send); - RW(player->npc.mHead, send); + RW(player->npc.mName, send, 1); + RW(player->npc.mModel, send, 1); + RW(player->npc.mRace, send, 1); + RW(player->npc.mHair, send), 1; + RW(player->npc.mHead, send), 1; RW(player->npc.mFlags, send); - RW(player->birthsign, send); + RW(player->birthsign, send, 1); - RW(player->creatureModel, send); + RW(player->creatureModel, send, 1); RW(player->useCreatureName, send); } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerCellChange.cpp b/components/openmw-mp/Packets/Player/PacketPlayerCellChange.cpp index 20d77fb86..665ce7d7d 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerCellChange.cpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerCellChange.cpp @@ -17,8 +17,6 @@ void mwmp::PacketPlayerCellChange::Packet(RakNet::BitStream *bs, bool send) { PlayerPacket::Packet(bs, send); - RW(player->cell.mData.mFlags, send); - RW(player->cell.mData.mX, send); - RW(player->cell.mData.mY, send); - RW(player->cell.mName, send); + RW(player->cell.mData, send, 1); + RW(player->cell.mName, send, 1); } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerCellState.cpp b/components/openmw-mp/Packets/Player/PacketPlayerCellState.cpp index 4a480a8b3..0546d86d7 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerCellState.cpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerCellState.cpp @@ -25,19 +25,13 @@ void mwmp::PacketPlayerCellState::Packet(RakNet::BitStream *bs, bool send) CellState cellState; if (send) - { cellState = player->cellStateChanges.cellStates.at(i); - } RW(cellState.type, send); - RW(cellState.cell.mData.mFlags, send); - RW(cellState.cell.mData.mX, send); - RW(cellState.cell.mData.mY, send); - RW(cellState.cell.mName, send); + RW(cellState.cell.mData, send, 1); + RW(cellState.cell.mName, send, 1); if (!send) - { player->cellStateChanges.cellStates.push_back(cellState); - } } } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerClass.cpp b/components/openmw-mp/Packets/Player/PacketPlayerClass.cpp index 7c63b9831..4925b1177 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerClass.cpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerClass.cpp @@ -17,8 +17,8 @@ void mwmp::PacketPlayerClass::Packet(RakNet::BitStream *bs, bool send) RW(player->charClass.mId, send); if (player->charClass.mId.empty()) // custom class { - RW(player->charClass.mName, send); - RW(player->charClass.mDescription, send); - RW(player->charClass.mData, send); + RW(player->charClass.mName, send, 1); + RW(player->charClass.mDescription, send, 1); + RW(player->charClass.mData, send, 1); } } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerDeath.hpp b/components/openmw-mp/Packets/Player/PacketPlayerDeath.hpp index 7d84575a2..d65099114 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerDeath.hpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerDeath.hpp @@ -23,7 +23,7 @@ namespace mwmp PlayerPacket::Packet(bs, send); RW(player->creatureStats.mDead, send); - RW(player->deathReason, send); + RW(player->deathReason, send, 1); } }; } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerEquipment.cpp b/components/openmw-mp/Packets/Player/PacketPlayerEquipment.cpp index c1e695589..07fcfe8e4 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerEquipment.cpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerEquipment.cpp @@ -18,7 +18,7 @@ void PacketPlayerEquipment::Packet(RakNet::BitStream *bs, bool send) for (int i = 0; i < 19; i++) { - RW(player->equipedItems[i].refId, send); + RW(player->equipedItems[i].refId, send, 1); RW(player->equipedItems[i].count, send); RW(player->equipedItems[i].charge, send); } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerFaction.cpp b/components/openmw-mp/Packets/Player/PacketPlayerFaction.cpp index 3c5dba466..2b5c6a387 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerFaction.cpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerFaction.cpp @@ -27,7 +27,7 @@ void PacketPlayerFaction::Packet(RakNet::BitStream *bs, bool send) if (send) faction = player->factionChanges.factions.at(i); - RW(faction.factionId, send); + RW(faction.factionId, send, 1); RW(faction.rank, send); RW(faction.isExpelled, send); diff --git a/components/openmw-mp/Packets/Player/PacketPlayerInventory.cpp b/components/openmw-mp/Packets/Player/PacketPlayerInventory.cpp index 808d81431..e48c28941 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerInventory.cpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerInventory.cpp @@ -31,17 +31,13 @@ void PacketPlayerInventory::Packet(RakNet::BitStream *bs, bool send) Item item; if (send) - { item = player->inventoryChanges.items.at(i); - } - RW(item.refId, send); + RW(item.refId, send, 1); RW(item.count, send); RW(item.charge, send); if (!send) - { player->inventoryChanges.items.push_back(item); - } } } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerJournal.cpp b/components/openmw-mp/Packets/Player/PacketPlayerJournal.cpp index c1dce47a8..a08e1f295 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerJournal.cpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerJournal.cpp @@ -28,18 +28,16 @@ void PacketPlayerJournal::Packet(RakNet::BitStream *bs, bool send) journalItem = player->journalChanges.journalItems.at(i); RW(journalItem.type, send); - RW(journalItem.quest, send); + RW(journalItem.quest, send, 1); RW(journalItem.index, send); if (journalItem.type == JournalItem::ENTRY) { - RW(journalItem.actorRefId, send); + RW(journalItem.actorRefId, send, 1); RW(journalItem.actorRefNumIndex, send); RW(journalItem.actorMpNum, send); - RW(journalItem.actorCell.mData.mFlags, send); - RW(journalItem.actorCell.mData.mX, send); - RW(journalItem.actorCell.mData.mY, send); - RW(journalItem.actorCell.mName, send); + RW(journalItem.actorCell.mData, send, 1); + RW(journalItem.actorCell.mName, send, 1); } if (!send) diff --git a/components/openmw-mp/Packets/Player/PacketPlayerSkill.cpp b/components/openmw-mp/Packets/Player/PacketPlayerSkill.cpp index 6ced9194e..ea25463ec 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerSkill.cpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerSkill.cpp @@ -18,11 +18,10 @@ void PacketPlayerSkill::Packet(RakNet::BitStream *bs, bool send) { PlayerPacket::Packet(bs, send); - for (int i = 0; i < SkillCount; ++i) - RW(player->npcStats.mSkills[i], send); + RW(player->npcStats.mSkills, send); - for (int i = 0; i < AttributeCount; ++i) - RW(player->npcStats.mSkillIncrease[i], send); + + RW(player->npcStats.mSkillIncrease, send); RW(player->npcStats.mLevelProgress, send); } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerSpellbook.cpp b/components/openmw-mp/Packets/Player/PacketPlayerSpellbook.cpp index 00f9d64ca..724885eb4 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerSpellbook.cpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerSpellbook.cpp @@ -27,16 +27,12 @@ void PacketPlayerSpellbook::Packet(RakNet::BitStream *bs, bool send) ESM::Spell spell; if (send) - { spell = player->spellbookChanges.spells.at(i); - } - RW(spell.mId, send); + RW(spell.mId, send, 1); if (!send) - { player->spellbookChanges.spells.push_back(spell); - } } } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerTopic.cpp b/components/openmw-mp/Packets/Player/PacketPlayerTopic.cpp index b5612998f..4fbdefc60 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerTopic.cpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerTopic.cpp @@ -27,7 +27,7 @@ void PacketPlayerTopic::Packet(RakNet::BitStream *bs, bool send) if (send) topic = player->topicChanges.topics.at(i); - RW(topic.topicId, send); + RW(topic.topicId, send, 1); if (!send) player->topicChanges.topics.push_back(topic);