diff --git a/components/openmw-mp/Controllers/ActorPacketController.cpp b/components/openmw-mp/Controllers/ActorPacketController.cpp index 59aa9de01..060bc02b6 100644 --- a/components/openmw-mp/Controllers/ActorPacketController.cpp +++ b/components/openmw-mp/Controllers/ActorPacketController.cpp @@ -43,7 +43,7 @@ mwmp::ActorPacketController::ActorPacketController(RakNet::RakPeerInterface *pee mwmp::ActorPacket *mwmp::ActorPacketController::GetPacket(RakNet::MessageID id) { - return packets[(unsigned char)id].get(); + return packets[(RakNet::MessageID)id].get(); } void mwmp::ActorPacketController::SetStream(RakNet::BitStream *inStream, RakNet::BitStream *outStream) diff --git a/components/openmw-mp/Controllers/ActorPacketController.hpp b/components/openmw-mp/Controllers/ActorPacketController.hpp index 179c70d56..47cfff0a7 100644 --- a/components/openmw-mp/Controllers/ActorPacketController.hpp +++ b/components/openmw-mp/Controllers/ActorPacketController.hpp @@ -18,7 +18,7 @@ namespace mwmp bool ContainsPacket(RakNet::MessageID id); - typedef std::unordered_map > packets_t; + typedef std::unordered_map > packets_t; private: packets_t packets; }; diff --git a/components/openmw-mp/Packets/Actor/ActorPacket.cpp b/components/openmw-mp/Packets/Actor/ActorPacket.cpp index b406ed1fc..37ae661fc 100644 --- a/components/openmw-mp/Packets/Actor/ActorPacket.cpp +++ b/components/openmw-mp/Packets/Actor/ActorPacket.cpp @@ -53,8 +53,8 @@ bool ActorPacket::PacketHeader(RakNet::BitStream *bs, bool send) { BasePacket::Packet(bs, send); - RW(actorList->cell.mData, send, 1); - RW(actorList->cell.mName, send, 1); + RW(actorList->cell.mData, send, true); + RW(actorList->cell.mName, send, true); if (send) actorList->count = (unsigned int)(actorList->baseActors.size()); diff --git a/components/openmw-mp/Packets/Actor/PacketActorAuthority.cpp b/components/openmw-mp/Packets/Actor/PacketActorAuthority.cpp index a1886dc9c..11157cba1 100644 --- a/components/openmw-mp/Packets/Actor/PacketActorAuthority.cpp +++ b/components/openmw-mp/Packets/Actor/PacketActorAuthority.cpp @@ -12,6 +12,6 @@ void PacketActorAuthority::Packet(RakNet::BitStream *bs, bool send) { BasePacket::Packet(bs, send); - RW(actorList->cell.mData, send, 1); - RW(actorList->cell.mName, send, 1); + RW(actorList->cell.mData, send, true); + RW(actorList->cell.mName, send, true); } diff --git a/components/openmw-mp/Packets/Actor/PacketActorCellChange.cpp b/components/openmw-mp/Packets/Actor/PacketActorCellChange.cpp index 394c181ed..d6e9fc8fc 100644 --- a/components/openmw-mp/Packets/Actor/PacketActorCellChange.cpp +++ b/components/openmw-mp/Packets/Actor/PacketActorCellChange.cpp @@ -11,9 +11,9 @@ PacketActorCellChange::PacketActorCellChange(RakNet::RakPeerInterface *peer) : A void PacketActorCellChange::Actor(BaseActor &actor, bool send) { - RW(actor.cell.mData, send, 1); - RW(actor.cell.mName, send, 1); + RW(actor.cell.mData, send, true); + RW(actor.cell.mName, send, true); - RW(actor.position, send, 1); - RW(actor.direction, send, 1); + RW(actor.position, send, true); + RW(actor.direction, send, true); } diff --git a/components/openmw-mp/Packets/Actor/PacketActorEquipment.cpp b/components/openmw-mp/Packets/Actor/PacketActorEquipment.cpp index 513fd2833..42a519347 100644 --- a/components/openmw-mp/Packets/Actor/PacketActorEquipment.cpp +++ b/components/openmw-mp/Packets/Actor/PacketActorEquipment.cpp @@ -11,10 +11,10 @@ PacketActorEquipment::PacketActorEquipment(RakNet::RakPeerInterface *peer) : Act void PacketActorEquipment::Actor(BaseActor &actor, bool send) { - for (int j = 0; j < 19; j++) + for (auto &&equipedItem : actor.equipedItems) { - RW(actor.equipedItems[j].refId, send); - RW(actor.equipedItems[j].count, send); - RW(actor.equipedItems[j].charge, send); + RW(equipedItem.refId, send); + RW(equipedItem.count, send); + RW(equipedItem.charge, send); } } diff --git a/components/openmw-mp/Packets/Actor/PacketActorPosition.cpp b/components/openmw-mp/Packets/Actor/PacketActorPosition.cpp index 53c6c8e8b..238eb0f1e 100644 --- a/components/openmw-mp/Packets/Actor/PacketActorPosition.cpp +++ b/components/openmw-mp/Packets/Actor/PacketActorPosition.cpp @@ -11,8 +11,8 @@ PacketActorPosition::PacketActorPosition(RakNet::RakPeerInterface *peer) : Actor void PacketActorPosition::Actor(BaseActor &actor, bool send) { - RW(actor.position, send, 1); - RW(actor.direction, send, 1); + RW(actor.position, send, true); + RW(actor.direction, send, true); actor.hasPositionData = true; }