openmw-tes3coop/apps/openmw-mp/processors/actor/ProcessorActorAttack.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
773 B
C++

#ifndef OPENMW_PROCESSORACTORATTACK_HPP
#define OPENMW_PROCESSORACTORATTACK_HPP
#include "../ActorProcessor.hpp"
namespace mwmp
{
class ProcessorActorAttack final: public ActorProcessor
{
public:
ProcessorActorAttack()
{
BPP_INIT(ID_ACTOR_ATTACK)
}
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_PROCESSORACTORATTACK_HPP