mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 02:19:55 +00:00
c075496748
Add serverside script functions for determining the killers of both players and actors. Use unsigned ints for script functions returning an object or actor's refNumIndex or mpNum. Remove updateDeadState() from LocalPlayer and make its code part of updateStatsDynamic() for simplicity.
30 lines
732 B
C++
30 lines
732 B
C++
#ifndef OPENMW_PROCESSORPLAYERDEATH_HPP
|
|
#define OPENMW_PROCESSORPLAYERDEATH_HPP
|
|
|
|
#include "../PlayerProcessor.hpp"
|
|
#include <chrono>
|
|
|
|
namespace mwmp
|
|
{
|
|
class ProcessorPlayerDeath : public PlayerProcessor
|
|
{
|
|
public:
|
|
ProcessorPlayerDeath()
|
|
{
|
|
BPP_INIT(ID_PLAYER_DEATH)
|
|
}
|
|
|
|
void Do(PlayerPacket &packet, Player &player) override
|
|
{
|
|
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player.npc.mName.c_str());
|
|
|
|
player.creatureStats.mDead = true;
|
|
|
|
packet.Send(true);
|
|
|
|
Script::Call<Script::CallbackIdentity("OnPlayerDeath")>(player.getId());
|
|
}
|
|
};
|
|
}
|
|
|
|
#endif //OPENMW_PROCESSORPLAYERDEATH_HPP
|