1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 15:49:55 +00:00
openmw-tes3mp/apps/openmw/mwmp/processors/player/ProcessorPlayerBounty.hpp
2017-05-02 22:47:58 +03:00

38 lines
1 KiB
C++

#ifndef OPENMW_PROCESSORPLAYERBOUNTY_HPP
#define OPENMW_PROCESSORPLAYERBOUNTY_HPP
#include "apps/openmw/mwmp/PlayerProcessor.hpp"
namespace mwmp
{
class ProcessorPlayerBounty : public PlayerProcessor
{
public:
ProcessorPlayerBounty()
{
BPP_INIT(ID_PLAYER_BOUNTY)
}
virtual void Do(PlayerPacket &packet, BasePlayer *player)
{
if (isLocal())
{
if (isRequest())
static_cast<LocalPlayer *>(player)->updateBounty(true);
else
static_cast<LocalPlayer *>(player)->setBounty();
}
else if (player != 0)
{
MWWorld::Ptr ptrPlayer = static_cast<DedicatedPlayer *>(player)->getPtr();
MWMechanics::NpcStats *ptrNpcStats = &ptrPlayer.getClass().getNpcStats(ptrPlayer);
ptrNpcStats->setBounty(player->npcStats.mBounty);
}
}
};
}
#endif //OPENMW_PROCESSORPLAYERBOUNTY_HPP