1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 05:19:55 +00:00
openmw-tes3mp/components/openmw-mp/Packets/World/PacketObjectPlace.cpp
David Cernat 420dab10e1 [General] Track objects directly placed by players in ObjectPlace
This allows the OnPCDrop variable to get set correctly even when object placements have to go through the server first in order to gain a unique multiplayer index (mpNum).

Among other things, this makes it possible to roll marijuana joints in the popular mod "Tribunal Code Patch".
2018-01-28 17:46:51 +02:00

21 lines
603 B
C++

#include <components/openmw-mp/NetworkMessages.hpp>
#include "PacketObjectPlace.hpp"
using namespace mwmp;
PacketObjectPlace::PacketObjectPlace(RakNet::RakPeerInterface *peer) : WorldPacket(peer)
{
packetID = ID_OBJECT_PLACE;
hasCellData = true;
}
void PacketObjectPlace::Object(WorldObject &worldObject, bool send)
{
WorldPacket::Object(worldObject, send);
RW(worldObject.count, send);
RW(worldObject.charge, send);
RW(worldObject.enchantmentCharge, send);
RW(worldObject.goldValue, send);
RW(worldObject.position, send);
RW(worldObject.droppedByPlayer, send);
}