forked from teamnwah/openmw-tes3coop
35 lines
1 KiB
C++
35 lines
1 KiB
C++
#ifndef OPENMW_PROCESSORACTOREQUIPMENT_HPP
|
|
#define OPENMW_PROCESSORACTOREQUIPMENT_HPP
|
|
|
|
#include <apps/openmw-mp/Actors.hpp>
|
|
#include "../ActorProcessor.hpp"
|
|
|
|
namespace mwmp
|
|
{
|
|
class ProcessorActorEquipment final: public ActorProcessor
|
|
{
|
|
public:
|
|
ProcessorActorEquipment()
|
|
{
|
|
BPP_INIT(ID_ACTOR_EQUIPMENT)
|
|
}
|
|
|
|
void Do(ActorPacket &packet, const std::shared_ptr<Player> &player, BaseActorList &actorList) override
|
|
{
|
|
std::vector<std::shared_ptr<Actor>> actors;
|
|
|
|
for (auto &baseActor : actorList.baseActors)
|
|
{
|
|
Actor *actor = new Actor;
|
|
actor->actor = baseActor;
|
|
actors.emplace_back(actor);
|
|
}
|
|
|
|
Networking::get().getState().getEventCtrl().Call<CoreEvent::ON_ACTOR_EQUIPMENT>(player.get(), actors);
|
|
|
|
Networking::get().getState().getActorCtrl().sendActors(player, actors, actorList.cell, true);
|
|
}
|
|
};
|
|
}
|
|
|
|
#endif //OPENMW_PROCESSORACTOREQUIPMENT_HPP
|