1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 10:49:57 +00:00
openmw-tes3mp/apps/openmw/mwmp/processors/player/ProcessorPlayerEquipment.hpp
David Cernat e70faf1016 [Client] Fix crashes in PlayerProcessors from NULL players
Also rename ProcessorPlayerDrawState into ProcessorPlayerAnimFlags
2017-04-24 01:46:27 +03:00

36 lines
881 B
C++

//
// Created by koncord on 16.04.17.
//
#ifndef OPENMW_PROCESSORPLAYEREQUIPMENT_HPP
#define OPENMW_PROCESSORPLAYEREQUIPMENT_HPP
#include "apps/openmw/mwmp/PlayerProcessor.hpp"
namespace mwmp
{
class ProcessorPlayerEquipment : public PlayerProcessor
{
public:
ProcessorPlayerEquipment()
{
BPP_INIT(ID_PLAYER_EQUIPMENT)
}
virtual void Do(PlayerPacket &packet, BasePlayer *player)
{
if (isLocal())
{
if (isRequest())
static_cast<LocalPlayer*>(player)->updateEquipment(true);
else
static_cast<LocalPlayer*>(player)->setEquipment();
}
else if (player != 0)
static_cast<DedicatedPlayer*>(player)->updateEquipment();
}
};
}
#endif //OPENMW_PROCESSORPLAYEREQUIPMENT_HPP