forked from teamnwah/openmw-tes3coop
f35d35741e
Remove BaseEvent::worldObjectCount Remove BaseActor::count Use foreach loops in packets and processors Remove redundant "&" in CellController::get().getCell() calls
27 lines
749 B
C++
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
|