openmw-tes3coop/apps/openmw-mp/processors/world/ProcessorDoorState.hpp

30 lines
791 B
C++

#ifndef OPENMW_PROCESSORDOORSTATE_HPP
#define OPENMW_PROCESSORDOORSTATE_HPP
#include "../WorldProcessor.hpp"
namespace mwmp
{
class ProcessorDoorState final: public WorldProcessor
{
public:
ProcessorDoorState()
{
BPP_INIT(ID_DOOR_STATE)
}
void Do(WorldPacket &packet, const std::shared_ptr<Player> &player, BaseEvent &event) override
{
packet.Send(true);
auto objCtrl = Networking::get().getState().getObjectCtrl();
auto objects = objCtrl.copyObjects(event);
Networking::get().getState().getEventCtrl().Call<CoreEvent::ON_DOOR_STATE>(player, objects);
objCtrl.sendObjects(player, objects, event.cell);
}
};
}
#endif //OPENMW_PROCESSORDOORSTATE_HPP