openmw-tes3coop/apps/openmw-mp/processors/actor/ProcessorActorAI.hpp
Koncord f35d35741e [General] Remove redundant code
Remove BaseEvent::worldObjectCount
Remove BaseActor::count
Use foreach loops in packets and processors
Remove redundant "&" in CellController::get().getCell() calls
2017-12-09 14:59:41 +08:00

27 lines
749 B
C++

#ifndef OPENMW_PROCESSORACTORAI_HPP
#define OPENMW_PROCESSORACTORAI_HPP
#include "../ActorProcessor.hpp"
namespace mwmp
{
class ProcessorActorAI final: public ActorProcessor
{
public:
ProcessorActorAI()
{
BPP_INIT(ID_ACTOR_AI)
}
void Do(ActorPacket &packet, const std::shared_ptr<Player> &player, BaseActorList &actorList) override
{
// Send only to players who have the cell loaded
Cell *serverCell = CellController::get().getCell(actorList.cell);
if (serverCell != nullptr && *serverCell->getAuthority() == actorList.guid)
serverCell->sendToLoaded(&packet, &actorList);
}
};
}
#endif //OPENMW_PROCESSORACTORAI_HPP