1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-07 07:45:32 +00:00
openmw-tes3mp/apps/openmw/mwmp/processors/player/ProcessorPlayerAttribute.hpp
David Cernat ed15d9ebf5 Merge pull request #406 from TES3MP/0.6.3 while resolving conflicts
Conflicts:
	apps/openmw-mp/Script/Functions/Mechanics.cpp
	apps/openmw-mp/Script/Functions/Mechanics.hpp
	components/openmw-mp/Base/BasePlayer.hpp
2018-04-13 18:05:38 +03:00

41 lines
991 B
C++

//
// Created by koncord on 16.04.17.
//
#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