[General] Add extra death debug, don't request data from player on death

pull/183/merge
David Cernat 8 years ago
parent c4b11a1251
commit 0d32bf5943

@ -386,12 +386,10 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
case ID_PLAYER_RESURRECT:
{
DEBUG_PRINTF("ID_PLAYER_RESURRECT\n");
//packetResurrect.Read(player);
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received ID_PLAYER_RESURRECT from %s", player->npc.mName.c_str());
player->creatureStats.mDead = false;
myPacket->Send(player, true);
playerController->GetPacket(ID_PLAYER_POS)->RequestData(player->guid);
playerController->GetPacket(ID_PLAYER_CELL_CHANGE)->RequestData(player->guid);
Script::Call<Script::CallbackIdentity("OnPlayerResurrect")>(player->getId());

@ -452,8 +452,11 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
case ID_PLAYER_DEATH:
{
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received ID_PLAYER_DEATH from server");
if (guid == myGuid)
{
LOG_APPEND(Log::LOG_INFO, "- Packet was about me");
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
MWMechanics::DynamicStat<float> health = player.getClass().getCreatureStats(player).getHealth();
health.setCurrent(0);
@ -463,6 +466,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
else if (pl != 0)
{
LOG_APPEND(Log::LOG_INFO, "- Packet was about %s", pl->npc.mName.c_str());
MWMechanics::DynamicStat<float> health;
pl->creatureStats.mDead = true;
health.readState(pl->creatureStats.mDynamic[0]);
@ -474,8 +478,12 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
}
case ID_PLAYER_RESURRECT:
{
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received ID_PLAYER_RESURRECT from server");
if (guid == myGuid)
{
LOG_APPEND(Log::LOG_INFO, "- Packet was about me");
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
player.getClass().getCreatureStats(player).resurrect();
@ -490,6 +498,8 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
}
else if (pl != 0)
{
LOG_APPEND(Log::LOG_INFO, "- Packet was about %s", pl->npc.mName.c_str());
pl->creatureStats.mDead = false;
if (pl->creatureStats.mDynamic[0].mMod < 1)
pl->creatureStats.mDynamic[0].mMod = 1;

@ -161,7 +161,7 @@ add_component_dir (openmw-mp
Packets/Player/PacketPlayerSpellbook Packets/Player/PacketPlayerJournal Packets/Player/PacketPlayerActiveSkills
Packets/Player/PacketPlayerCellChange Packets/Player/PacketPlayerCellState
Packets/Player/PacketPlayerResurrect
Packets/Player/PacketPlayerDeath Packets/Player/PacketPlayerResurrect
Packets/Player/PacketGUIBoxes Packets/Player/PacketTime

Loading…
Cancel
Save