mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-15 19:49:54 +00:00
8df08c7d10
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.
25 lines
579 B
C++
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
|