1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-24 21:23:51 +00:00
openmw-tes3mp/apps/openmw/mwmp/processors/player/ProcessorPlayerStatsDynamic.hpp

36 lines
886 B
C++
Raw Normal View History

#ifndef OPENMW_PROCESSORPLAYERSTATSDYNAMIC_HPP
#define OPENMW_PROCESSORPLAYERSTATSDYNAMIC_HPP
2017-04-16 07:00:25 +00:00
2017-06-06 16:06:10 +00:00
#include "../PlayerProcessor.hpp"
2017-04-16 07:00:25 +00:00
namespace mwmp
{
class ProcessorPlayerStatsDynamic final: public PlayerProcessor
2017-04-16 07:00:25 +00:00
{
public:
ProcessorPlayerStatsDynamic()
2017-04-16 07:00:25 +00:00
{
2017-04-18 04:17:58 +00:00
BPP_INIT(ID_PLAYER_STATS_DYNAMIC)
2017-04-16 07:00:25 +00:00
}
virtual void Do(PlayerPacket &packet, BasePlayer *player)
{
if (isLocal())
{
if (isRequest())
2017-04-18 04:17:58 +00:00
static_cast<LocalPlayer *>(player)->updateStatsDynamic(true);
2017-04-16 07:00:25 +00:00
else
static_cast<LocalPlayer *>(player)->setDynamicStats();
}
else if (player != 0)
2017-04-16 07:00:25 +00:00
{
static_cast<DedicatedPlayer*>(player)->setStatsDynamic();
2017-04-16 07:00:25 +00:00
}
}
};
}
#endif //OPENMW_PROCESSORPLAYERSTATSDYNAMIC_HPP