forked from mirror/openmw-tes3mp
7ffdb18bf9
ActorDeath packets are sent for dead actors before their StatsDynamic packets. They contain the actor's deathReason in a manner similar to that of PlayerDeath packets. A future commit will replace the deathReason with a variable named killer which will be an mwmp::Target.
31 lines
899 B
C++
31 lines
899 B
C++
#ifndef OPENMW_PROCESSORACTORDEATH_HPP
|
|
#define OPENMW_PROCESSORACTORDEATH_HPP
|
|
|
|
#include "../ActorProcessor.hpp"
|
|
|
|
namespace mwmp
|
|
{
|
|
class ProcessorActorDeath : public ActorProcessor
|
|
{
|
|
public:
|
|
ProcessorActorDeath()
|
|
{
|
|
BPP_INIT(ID_ACTOR_DEATH)
|
|
}
|
|
|
|
void Do(ActorPacket &packet, 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)
|
|
{
|
|
Script::Call<Script::CallbackIdentity("OnActorDeath")>(player.getId(), actorList.cell.getDescription().c_str());
|
|
|
|
serverCell->sendToLoaded(&packet, &actorList);
|
|
}
|
|
}
|
|
};
|
|
}
|
|
|
|
#endif //OPENMW_PROCESSORACTORDEATH_HPP
|