1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-24 05:53:51 +00:00
openmw-tes3mp/components/openmw-mp/Packets/Object/PacketClientScriptLocal.cpp
David Cernat 8db396d10a [General] Distinguish between shorts & longs in ClientScriptGlobal
Adjust ClientScriptLocal so it refers to its previously handled integers as shorts.
2020-02-17 18:19:03 +02:00

22 lines
849 B
C++

#include <components/openmw-mp/NetworkMessages.hpp>
#include "PacketClientScriptLocal.hpp"
using namespace mwmp;
PacketClientScriptLocal::PacketClientScriptLocal(RakNet::RakPeerInterface *peer) : ObjectPacket(peer)
{
packetID = ID_CLIENT_SCRIPT_LOCAL;
hasCellData = true;
}
void PacketClientScriptLocal::Object(BaseObject &baseObject, bool send)
{
ObjectPacket::Object(baseObject, send);
RW(baseObject.clientVariable.index, send);
RW(baseObject.clientVariable.variableType, send);
if (baseObject.clientVariable.variableType == mwmp::VARIABLE_TYPE::SHORT || baseObject.clientVariable.variableType == mwmp::VARIABLE_TYPE::LONG)
RW(baseObject.clientVariable.intValue, send);
else if (baseObject.clientVariable.variableType == mwmp::VARIABLE_TYPE::FLOAT)
RW(baseObject.clientVariable.floatValue, send);
}