2017-04-25 18:24:39 +00:00
|
|
|
#ifndef OPENMW_PROCESSORPLAYERBOUNTY_HPP
|
|
|
|
#define OPENMW_PROCESSORPLAYERBOUNTY_HPP
|
|
|
|
|
2017-06-06 16:06:10 +00:00
|
|
|
#include "../PlayerProcessor.hpp"
|
2017-04-25 18:24:39 +00:00
|
|
|
|
|
|
|
namespace mwmp
|
|
|
|
{
|
|
|
|
class ProcessorPlayerBounty : public PlayerProcessor
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ProcessorPlayerBounty()
|
|
|
|
{
|
|
|
|
BPP_INIT(ID_PLAYER_BOUNTY)
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void Do(PlayerPacket &packet, BasePlayer *player)
|
|
|
|
{
|
|
|
|
if (isLocal())
|
|
|
|
{
|
2017-05-02 19:47:58 +00:00
|
|
|
if (isRequest())
|
2017-04-25 18:24:39 +00:00
|
|
|
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
|