2020-02-05 15:41:48 +00:00
|
|
|
#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);
|
2020-02-10 05:58:35 +00:00
|
|
|
RW(baseObject.clientVariable.index, send);
|
|
|
|
RW(baseObject.clientVariable.variableType, send);
|
|
|
|
|
2020-02-17 16:19:03 +00:00
|
|
|
if (baseObject.clientVariable.variableType == mwmp::VARIABLE_TYPE::SHORT || baseObject.clientVariable.variableType == mwmp::VARIABLE_TYPE::LONG)
|
2020-02-10 05:58:35 +00:00
|
|
|
RW(baseObject.clientVariable.intValue, send);
|
|
|
|
else if (baseObject.clientVariable.variableType == mwmp::VARIABLE_TYPE::FLOAT)
|
|
|
|
RW(baseObject.clientVariable.floatValue, send);
|
2020-02-05 15:41:48 +00:00
|
|
|
}
|