mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 00:49:54 +00:00
a74bf1baec
(cherry picked from commit 7748e582a8
)
37 lines
949 B
C++
37 lines
949 B
C++
#ifndef OPENMW_PROCESSORPLAYERATTRIBUTE_HPP
|
|
#define OPENMW_PROCESSORPLAYERATTRIBUTE_HPP
|
|
|
|
|
|
#include "../PlayerProcessor.hpp"
|
|
#include "apps/openmw/mwmechanics/npcstats.hpp"
|
|
#include "apps/openmw/mwclass/npc.hpp"
|
|
|
|
namespace mwmp
|
|
{
|
|
class ProcessorPlayerAttribute final: public PlayerProcessor
|
|
{
|
|
public:
|
|
ProcessorPlayerAttribute()
|
|
{
|
|
BPP_INIT(ID_PLAYER_ATTRIBUTE)
|
|
}
|
|
|
|
virtual void Do(PlayerPacket &packet, BasePlayer *player)
|
|
{
|
|
if (isLocal())
|
|
{
|
|
if (isRequest())
|
|
static_cast<LocalPlayer *>(player)->updateAttributes(true);
|
|
else
|
|
static_cast<LocalPlayer *>(player)->setAttributes();
|
|
}
|
|
else if (player != 0)
|
|
{
|
|
static_cast<DedicatedPlayer *>(player)->setAttributes();
|
|
}
|
|
}
|
|
};
|
|
}
|
|
|
|
|
|
#endif //OPENMW_PROCESSORPLAYERATTRIBUTE_HPP
|