1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 19:49:54 +00:00
openmw-tes3mp/apps/openmw-mp/processors/player/ProcessorPlayerItemUse.hpp
David Cernat 8df08c7d10 [General] Implement PlayerItemUse packet
Players can no longer unilaterally use items on themselves in their inventory. When they try to use an item, they send a PlayerItemUse packet to the server with the item's details. A serverside script can then check the item and either send the packet back to make the item use go through or drop it.
2018-08-09 18:25:20 +03:00

25 lines
579 B
C++

#ifndef OPENMW_PROCESSORPLAYERITEMUSE_HPP
#define OPENMW_PROCESSORPLAYERITEMUSE_HPP
#include "../PlayerProcessor.hpp"
namespace mwmp
{
class ProcessorPlayerItemUse : public PlayerProcessor
{
public:
ProcessorPlayerItemUse()
{
BPP_INIT(ID_PLAYER_ITEM_USE)
}
void Do(PlayerPacket &packet, Player &player) override
{
DEBUG_PRINTF(strPacketID.c_str());
Script::Call<Script::CallbackIdentity("OnPlayerItemUse")>(player.getId());
}
};
}
#endif //OPENMW_PROCESSORPLAYERITEMUSE_HPP