mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-04-02 02:36:43 +00:00
Make the local player send a packet whenever moving from one exterior cell to another, don't require objects to have RefNums to be moved correctly between exterior cells, and increase the packet priority for cell changes.
29 lines
709 B
C++
29 lines
709 B
C++
//
|
|
// Created by koncord on 15.01.16.
|
|
//
|
|
|
|
#include <components/openmw-mp/NetworkMessages.hpp>
|
|
#include "PacketCell.hpp"
|
|
|
|
|
|
mwmp::PacketCell::PacketCell(RakNet::RakPeerInterface *peer) : BasePacket(peer)
|
|
{
|
|
packetID = ID_GAME_CELL;
|
|
priority = IMMEDIATE_PRIORITY;
|
|
reliability = RELIABLE_ORDERED;
|
|
}
|
|
|
|
void mwmp::PacketCell::Packet(RakNet::BitStream *bs, mwmp::BasePlayer *player, bool send)
|
|
{
|
|
BasePacket::Packet(bs, player, send);
|
|
|
|
RW(player->GetCell()->mData.mFlags, send);
|
|
|
|
if(player->GetCell()->isExterior())
|
|
{
|
|
RW(player->GetCell()->mCellId.mIndex.mX, send);
|
|
RW(player->GetCell()->mCellId.mIndex.mY, send);
|
|
}
|
|
else
|
|
RW(player->GetCell()->mName, send);
|
|
}
|