openmw-tes3coop/components/openmw-mp/Packets/Player/PacketSkill.cpp

29 lines
676 B
C++
Raw Normal View History

//
// Created by koncord on 17.03.16.
//
#include "PacketSkill.hpp"
#include <components/openmw-mp/NetworkMessages.hpp>
#include <components/esm/creaturestats.hpp>
using namespace mwmp;
2016-10-17 12:54:36 +00:00
PacketSkill::PacketSkill(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
{
packetID = ID_GAME_SKILL;
}
void PacketSkill::Packet(RakNet::BitStream *bs, BasePlayer *player, bool send)
{
2016-10-17 12:54:36 +00:00
PlayerPacket::Packet(bs, player, send);
2016-09-30 04:15:59 +00:00
for (int i = 0; i < SkillCount; ++i)
RW(player->NpcStats()->mSkills[i], send);
2016-09-30 04:15:59 +00:00
for (int i = 0; i < AttributeCount; ++i)
RW(player->NpcStats()->mSkillIncrease[i], send);
RW(player->NpcStats()->mLevelProgress, send);
}