forked from teamnwah/openmw-tes3coop
32 lines
935 B
C++
32 lines
935 B
C++
#ifndef OPENMW_PROCESSOROBJECTTRAP_HPP
|
|
#define OPENMW_PROCESSOROBJECTTRAP_HPP
|
|
|
|
#include "../WorldProcessor.hpp"
|
|
|
|
namespace mwmp
|
|
{
|
|
class ProcessorObjectTrap final: public WorldProcessor
|
|
{
|
|
public:
|
|
ProcessorObjectTrap()
|
|
{
|
|
BPP_INIT(ID_OBJECT_TRAP)
|
|
}
|
|
|
|
void Do(WorldPacket &packet, const std::shared_ptr<Player> &player, BaseEvent &event) override
|
|
{
|
|
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player->npc.mName.c_str());
|
|
|
|
packet.Send(true);
|
|
|
|
auto objCtrl = Networking::get().getState().getObjectCtrl();
|
|
auto objects = objCtrl.copyObjects(event);
|
|
|
|
Networking::get().getState().getEventCtrl().Call<CoreEvent::ON_OBJECT_TRAP>(player.get(), objects);
|
|
|
|
objCtrl.sendObjects(player, objects, event.cell);
|
|
}
|
|
};
|
|
}
|
|
|
|
#endif //OPENMW_PROCESSOROBJECTTRAP_HPP
|