Skip to content

An OpenMW mod that lets you play the whole Elder Scrolls III: Morrowind as a top-down isometric game — with full online co-op or MMO modes.

C++
949 B
Raw Blame
#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