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++
978 B
Raw Blame
#ifndef OPENMW_PROCESSORPLAYERPOSITION_HPP
#define OPENMW_PROCESSORPLAYERPOSITION_HPP


#include "../PlayerProcessor.hpp"

namespace mwmp
{
    class ProcessorPlayerPosition final: public PlayerProcessor
    {
    public:
        ProcessorPlayerPosition()
        {
            BPP_INIT(ID_PLAYER_POSITION)
        }

        virtual void Do(PlayerPacket &packet, BasePlayer *player)
        {
            if (isLocal())
            {
                if (!isRequest())
                {
                    LOG_MESSAGE_SIMPLE(TimedLog::LOG_INFO, "ID_PLAYER_POSITION changed by server");

                    static_cast<LocalPlayer*>(player)->setPosition();
                }
                else
                    static_cast<LocalPlayer*>(player)->updatePosition(true);
            }
            else if (player != 0) // dedicated player
                static_cast<DedicatedPlayer*>(player)->updateMarker();
        }
    };
}


#endif //OPENMW_PROCESSORPLAYERPOSITION_HPP