mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-24 14:23:51 +00:00
a74bf1baec
(cherry picked from commit 7748e582a8
)
39 lines
1.1 KiB
C++
39 lines
1.1 KiB
C++
#ifndef OPENMW_PROCESSORPLAYERQUICKKEYS_HPP
|
|
#define OPENMW_PROCESSORPLAYERQUICKKEYS_HPP
|
|
|
|
|
|
#include "../PlayerProcessor.hpp"
|
|
|
|
namespace mwmp
|
|
{
|
|
class ProcessorPlayerQuickKeys final: public PlayerProcessor
|
|
{
|
|
public:
|
|
ProcessorPlayerQuickKeys()
|
|
{
|
|
BPP_INIT(ID_PLAYER_QUICKKEYS)
|
|
}
|
|
|
|
virtual void Do(PlayerPacket &packet, BasePlayer *player)
|
|
{
|
|
if (!isLocal()) return;
|
|
|
|
LOG_MESSAGE_SIMPLE(TimedLog::LOG_INFO, "Received ID_PLAYER_QUICKKEYS about LocalPlayer from server");
|
|
|
|
if (!isRequest())
|
|
{
|
|
LocalPlayer &localPlayer = static_cast<LocalPlayer&>(*player);
|
|
|
|
// Because we send PlayerQuickKeys packets from the same OpenMW methods that we use to set the
|
|
// quick keys received, we need to set a boolean to prevent resending the keys set here
|
|
localPlayer.isReceivingQuickKeys = true;
|
|
|
|
localPlayer.setQuickKeys();
|
|
|
|
localPlayer.isReceivingQuickKeys = false;
|
|
}
|
|
}
|
|
};
|
|
}
|
|
|
|
#endif //OPENMW_PROCESSORPLAYERQUICKKEYS_HPP
|